mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-08-05 16:37:46 +00:00
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:
@@ -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,4 +1,4 @@
|
||||
import React, { Component } from 'react';
|
||||
import { Component } from 'react';
|
||||
import type { ErrorInfo, ReactNode } from 'react';
|
||||
|
||||
interface Props {
|
||||
|
||||
Reference in New Issue
Block a user