Fix Express 5 404 handler: Use middleware pattern instead of route
Express 5 doesn't support wildcard routes with app.all('*').
Changed to standard middleware pattern: app.use((req, res) => {...})
This commit is contained in:
parent
f3c808952d
commit
2194f55d68
1 changed files with 2 additions and 2 deletions
|
|
@ -133,8 +133,8 @@ app.use('/api/documents', documentRoutes);
|
|||
app.use('/api/subscriptions', subscriptionRoutes);
|
||||
app.use('/api/notifications', notificationRoutes);
|
||||
|
||||
// 404 handler - Express 5 requires explicit path
|
||||
app.all('*', (req, res) => {
|
||||
// 404 handler - Express 5 compatible
|
||||
app.use((req, res) => {
|
||||
res.status(404).json({
|
||||
success: false,
|
||||
message: 'Route not found',
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue