Fix Express 5 breaking change: Replace app.use('*') with app.all('*')
Express 5 no longer supports wildcard '*' in app.use() for 404 handlers.
Changed to app.all('*') which is the correct Express 5 pattern.
This commit is contained in:
parent
6c9faf7df0
commit
f3c808952d
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/subscriptions', subscriptionRoutes);
|
||||||
app.use('/api/notifications', notificationRoutes);
|
app.use('/api/notifications', notificationRoutes);
|
||||||
|
|
||||||
// 404 handler
|
// 404 handler - Express 5 requires explicit path
|
||||||
app.use('*', (req, res) => {
|
app.all('*', (req, res) => {
|
||||||
res.status(404).json({
|
res.status(404).json({
|
||||||
success: false,
|
success: false,
|
||||||
message: 'Route not found',
|
message: 'Route not found',
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue