From 0ca4e07e23683a17de3d7cc18dc6c9237600f732 Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Thu, 17 Sep 2026 19:17:00 +0000 Subject: [PATCH] Dev server: serve paskia-js module, rework examples page The Vite dev server now maps /paskia-js/ to the local paskia-js build (the examples page's module import has 404'd since it was introduced, leaving all buttons dead). Navigation actions on the examples page are now plain same-window links so the flows' back navigation returns to the page; added a Profile Summary button exercising profile(). --- examples/index.html | 37 ++++++++++++++++++++++++++----------- frontend/vite.config.js | 8 ++++++++ 2 files changed, 34 insertions(+), 11 deletions(-) diff --git a/examples/index.html b/examples/index.html index dac6fe0..ab4e789 100644 --- a/examples/index.html +++ b/examples/index.html @@ -8,6 +8,17 @@ :root { color-scheme: light dark; /* Automatic themes by browser */ } + .section a, .section button { + display: inline-block; + padding: 0.2em 0.6em; + margin: 1px 4px 1px 0; + border: none; + background: #ccc8; + color: inherit; + font: inherit; + text-decoration: none; + cursor: pointer; + } @@ -20,8 +31,8 @@

Management Site

- - + 👤 User Profile + ⚙️ Admin Panel
@@ -30,15 +41,16 @@ +

Browser Mode (full page)

-

Block access to otherwise open site - intended for forward-auth mechanism (Caddy, Nginx):

- - - +

Block access to otherwise open site - intended for forward-auth mechanism (Caddy, Nginx). If not authenticated, you'll see the login page; after auth, a 204 response (blank page = success). Back returns here:

+ 🔐 Basic Auth + 🔄 Reauth (max_age=10s) + 🛡️ Admin Only
Click a button to test...
@@ -46,7 +58,7 @@
diff --git a/frontend/vite.config.js b/frontend/vite.config.js index e6051be..a3cb051 100644 --- a/frontend/vite.config.js +++ b/frontend/vite.config.js @@ -64,6 +64,14 @@ export default defineConfig(({ command }) => ({ }) } }, + { + name: 'serve-paskia-js', + configureServer(server) { + // Serve the locally built paskia-js module for the examples page + const serve = sirv(resolve(__dirname, '../paskia-js'), { dev: true }) + server.middlewares.use('/paskia-js', serve) + } + }, { name: 'serve-examples', configureServer(server) {