tests cannot connect to db
Some checks failed
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Failing after 1m5s

This commit is contained in:
2025-11-23 13:37:07 -08:00
parent b8f1f12461
commit 51a71ccc78
3 changed files with 26 additions and 2 deletions

View File

@@ -125,4 +125,26 @@ app.use((err: Error, req: Request, res: Response, next: NextFunction) => {
const PORT = process.env.PORT || 3001;
app.listen(PORT, () => {
logger.info(`Authentication server started on port ${PORT}`);
});
});
// --- START ROUTE DEBUGGING ---
// On server startup, print all registered routes to the console.
// This helps debug 404s by showing exactly what Express thinks the routes are.
const routes: { method: string, path: string }[] = [];
app._router.stack.forEach((middleware: any) => {
if (middleware.route) { // routes registered directly on the app
routes.push({
method: Object.keys(middleware.route.methods).join(', ').toUpperCase(),
path: middleware.route.path
});
} else if (middleware.name === 'router') { // router instances
middleware.handle.stack.forEach((handler: any) => {
const route = handler.route;
route && routes.push({ method: Object.keys(route.methods).join(', ').toUpperCase(), path: `${middleware.regexp.source.replace('\\/?(?=\\/|$)', '').slice(1)}${route.path}`});
});
}
});
console.log('--- REGISTERED API ROUTES ---');
console.table(routes);
console.log('-----------------------------');
// --- END ROUTE DEBUGGING ---