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:
TheMaddax 2025-12-14 16:46:13 -07:00
parent f3c808952d
commit 2194f55d68

View file

@ -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',