From b5f1375a87017a420317e84dad38d3ca00723d3d Mon Sep 17 00:00:00 2001 From: Karl Date: Thu, 17 Jul 2025 16:34:17 +0100 Subject: [PATCH] use the baseurl for the call --- templates/base.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/templates/base.html b/templates/base.html index 12db588..aed1bd0 100644 --- a/templates/base.html +++ b/templates/base.html @@ -74,7 +74,8 @@ } function subscribeUser(registration) { - fetch('http://localhost:3001/vapid-public-key') + const baseUrl = '{{ config.BASE_URL }}'.replace(/\/$/, ""); // Remove trailing slash if present + fetch(`${baseUrl}/vapid-public-key`) .then(response => response.json()) .then(data => { const applicationServerKey = urlB64ToUint8Array(data.public_key); @@ -91,7 +92,8 @@ } function saveSubscription(subscription) { - fetch('/save-subscription', { + const baseUrl = '{{ config.BASE_URL }}'.replace(/\/$/, ""); // Remove trailing slash if present + fetch(`${baseUrl}/save-subscription`, { method: 'POST', headers: { 'Content-Type': 'application/json',