Skip to content

SPA routing: Fastify needs to serve index.html for all React Router routes #1011

@coderabbitai

Description

@coderabbitai

Problem

Currently, only the /streamFile route is configured to serve index.html in the Fastify server. Other React Router defined routes in the SPA will return 404 errors when accessed directly via URL or when users refresh the page.

Current Implementation

In components/log-viewer-webui/server/src/routes/static.ts, we have:

  • Static file serving with wildcard: false
  • Specific route handler for /streamFile that serves index.html

Expected Behavior

All React Router defined routes should be served with index.html so that the React application can handle client-side routing properly.

Related

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions