Skip to content

Commit 8d37b2f

Browse files
committed
docs: Clarify SPA fallback purpose and remove misleading routing comment
- Remove incorrect claim that fallback "enables client-side routing" - Clarify that the app uses DOM manipulation, not URL-based routing - Explain the fallback's actual purpose: support page refreshes and direct URL access - Consolidate comments for better readability
1 parent 8e766d2 commit 8d37b2f

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

src/webui/server/WebUIManager.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -231,11 +231,10 @@ export class WebUIManager extends EventEmitter {
231231
});
232232

233233
// SPA fallback - serve index.html for non-API routes that don't match static files
234-
// This enables client-side routing in the WebUI
235-
236-
// NOTE: Using path.extname() is safe here because this app does NOT use client-side routing.
237-
// All UI state is managed via DOM manipulation, not URL routes. If client-side routing
238-
// is added in the future, this should be changed to use Accept header detection instead.
234+
// NOTE: This app does NOT use client-side routing. All UI state is managed via DOM manipulation.
235+
// The fallback ensures page refreshes and direct URL access work correctly.
236+
// Using path.extname() to detect file requests is safe since there are no client-side routes.
237+
// If client-side routing is added in the future, this should use Accept header detection instead.
239238
this.expressApp.get('/*splat', (req, res, next) => {
240239
// Skip if this looks like a file request with extension (handled by static middleware)
241240
if (path.extname(req.path) && req.path !== '/') {

0 commit comments

Comments
 (0)