fix(server): use regex catch-all (Express 5 wildcard syntax change)
This commit is contained in:
+1
-1
@@ -53,7 +53,7 @@ const __dirname = path.dirname(__filename);
|
|||||||
const clientDist = path.resolve(__dirname, '../../client/dist');
|
const clientDist = path.resolve(__dirname, '../../client/dist');
|
||||||
if (existsSync(clientDist)) {
|
if (existsSync(clientDist)) {
|
||||||
app.use(express.static(clientDist, { index: false, maxAge: '1h' }));
|
app.use(express.static(clientDist, { index: false, maxAge: '1h' }));
|
||||||
app.get('*', (req, res, next) => {
|
app.get(/.*/, (req, res, next) => {
|
||||||
// Don't shadow API or well-known paths.
|
// Don't shadow API or well-known paths.
|
||||||
if (req.path.startsWith('/api') || req.path.startsWith('/.well-known')) return next();
|
if (req.path.startsWith('/api') || req.path.startsWith('/.well-known')) return next();
|
||||||
res.sendFile(path.join(clientDist, 'index.html'));
|
res.sendFile(path.join(clientDist, 'index.html'));
|
||||||
|
|||||||
Reference in New Issue
Block a user