fix: express 5 wildcard removed
This commit is contained in:
@@ -75,9 +75,11 @@ app.get('/health', (req, res) => {
|
||||
const clientPath = path.join(process.cwd(), 'dist', 'client');
|
||||
if (fs.existsSync(clientPath)) {
|
||||
app.use(express.static(clientPath));
|
||||
app.get('/:splat*', (req, res) => {
|
||||
app.use((req, res, next) => {
|
||||
if (!req.path.startsWith('/api') && !req.path.startsWith('/uploads')) {
|
||||
res.sendFile(path.join(clientPath, 'index.html'));
|
||||
} else {
|
||||
next();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user