refactor: update routing to use app.use for SPA compatibility and add architectural refactoring plan for directory-based stack structure

This commit is contained in:
SaelixCode
2026-02-20 20:15:03 -05:00
parent 800d47845f
commit 312ad6a4c4
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -500,7 +500,8 @@ if (process.env.NODE_ENV === 'production') {
app.use(express.static('public'));
// Handle SPA routing - serve index.html for non-API routes
app.get('*', (req: Request, res: Response) => {
// Using app.use middleware instead of app.get('*') for path-to-regexp compatibility
app.use((req: Request, res: Response) => {
if (!req.path.startsWith('/api')) {
res.sendFile('index.html', { root: 'public' });
}
+1 -1
View File
@@ -1,4 +1,4 @@
import React, { Component } from 'react';
import { Component } from 'react';
import type { ErrorInfo, ReactNode } from 'react';
interface Props {