Skip to content

Commit 3fc34b1

Browse files
committed
bug fixed after express upgrade
1 parent 3109236 commit 3fc34b1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

main.cjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ async function setupServer(isDev) {
4444
const app = express();
4545
app.use(express.static(path.join(__dirname, 'dist')));
4646

47-
app.get('*', (req, res) => {
47+
// Fallback middleware: serve index.html for any request not handled by static files.
48+
// Use a simple middleware instead of a route pattern to avoid path-to-regexp
49+
// parsing differences between the dev environment and the packaged app.
50+
app.use((req, res) => {
4851
res.sendFile(path.join(__dirname, 'dist', 'index.html'));
4952
});
5053

0 commit comments

Comments
 (0)