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:
parent
5f2cc06111
commit
0f8db7083c
4 changed files with 9 additions and 9 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue