frontend direct testing result and fixes
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 16m42s
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 16m42s
This commit is contained in:
12
server.ts
12
server.ts
@@ -287,6 +287,18 @@ app.use('/api/reactions', reactionsRouter);
|
||||
|
||||
// --- Error Handling and Server Startup ---
|
||||
|
||||
// Catch-all 404 handler for unmatched routes.
|
||||
// Returns JSON instead of HTML for API consistency.
|
||||
app.use((req: Request, res: Response) => {
|
||||
res.status(404).json({
|
||||
success: false,
|
||||
error: {
|
||||
code: 'NOT_FOUND',
|
||||
message: `Cannot ${req.method} ${req.path}`,
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
// Sentry Error Handler (ADR-015) - captures errors and sends to Bugsink.
|
||||
// Must come BEFORE the custom error handler but AFTER all routes.
|
||||
app.use(sentryMiddleware.errorHandler);
|
||||
|
||||
Reference in New Issue
Block a user