fix(gateway): serve PWA client under /client subpath

Move static files from / to /client to avoid conflicts with
WebSocket and existing HTTP endpoints. Update manifest, service
worker, and HTML asset references accordingly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
yushen 2026-01-30 14:35:40 +08:00
parent 5f2cc06111
commit 0f8db7083c
4 changed files with 9 additions and 9 deletions

View file

@ -13,8 +13,7 @@ const isDev = process.env.NODE_ENV !== "production";
imports: [
ServeStaticModule.forRoot({
rootPath: join(__dirname, "public"),
serveRoot: "/",
exclude: ["/api/(.*)", "/ws/(.*)"],
serveRoot: "/client",
}),
LoggerModule.forRoot({
pinoHttp: isDev

View file

@ -8,9 +8,9 @@
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="apple-mobile-web-app-title" content="Geneva">
<link rel="manifest" href="/manifest.json">
<link rel="icon" href="/icon.png" type="image/png">
<link rel="apple-touch-icon" href="/icon.png">
<link rel="manifest" href="manifest.json">
<link rel="icon" href="icon.png" type="image/png">
<link rel="apple-touch-icon" href="icon.png">
<style>
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
@ -485,7 +485,7 @@
// --- PWA: Register Service Worker ---
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/sw.js').catch(() => {});
navigator.serviceWorker.register('sw.js', { scope: '/client/' }).catch(() => {});
}
</script>
</body>

View file

@ -2,14 +2,15 @@
"name": "Geneva Client",
"short_name": "Geneva",
"description": "Mobile client for Geneva Gateway",
"start_url": "/",
"start_url": "/client/",
"scope": "/client/",
"display": "standalone",
"orientation": "portrait",
"theme_color": "#0f172a",
"background_color": "#0f172a",
"icons": [
{
"src": "/icon.png",
"src": "/client/icon.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "any maskable"

View file

@ -1,5 +1,5 @@
const CACHE_NAME = "geneva-client-v1";
const PRECACHE_URLS = ["/", "/icon.png"];
const PRECACHE_URLS = ["/client/", "/client/icon.png"];
self.addEventListener("install", (event) => {
event.waitUntil(