From 0084745cfb06f3a7b4667d22e894a8af1a03ba9e Mon Sep 17 00:00:00 2001 From: phil Date: Thu, 10 Jul 2025 19:38:22 +0000 Subject: [PATCH] minimal api server landing --- server/web-content/index.html | 150 +++++++++++++++++------------------------------------------------------------------------------------------------------------------------------------- server/web-content/service-worker.js | 29 ----------------------------- 2 file(s) changed, 17 insertion(s)(+), 162 deletion(s)(-) diff --git a/server/web-content/index.html b/server/web-content/index.html --- a/server/web-content/index.html +++ b/server/web-content/index.html @@ -1,134 +1,18 @@ - - -hiiiiii - - - - -

- - - + + + + notifications api + + +

hello!

+

this is the api server for spacedust demos!

+

the source code for this server is on github at at-microcosm/spacedust-utils.

+

demos:

+ + + diff --git a/server/web-content/service-worker.js b/server/web-content/service-worker.js deleted file mode 100644 --- a/server/web-content/service-worker.js +++ /dev/null @@ -1,29 +0,0 @@ -function urlBase64ToUint8Array(base64String) { - var padding = '='.repeat((4 - base64String.length % 4) % 4); - var base64 = (base64String + padding) - .replace(/\-/g, '+') - .replace(/_/g, '/'); - - var rawData = window.atob(base64); - var outputArray = new Uint8Array(rawData.length); - - for (var i = 0; i < rawData.length; ++i) { - outputArray[i] = rawData.charCodeAt(i); - } - return outputArray; -} - -self.addEventListener('push', function(event) { - const { title, body } = event.data.json(); - - // Display notification or handle data - // Example: show a notification - // const title = 'New Notification'; - // const body = event.data.text(); - // const icon = '/images/icon.png'; - // const tag = 'simple-push-demo-notification-tag'; - - event.waitUntil(self.registration.showNotification(title, { body })); - - // TODO: resubscribe to notifs to try to stay alive -}); -- tangled.sh