deploy moment aha
Some checks failed
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Failing after 1m16s
Some checks failed
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Failing after 1m16s
This commit is contained in:
25
server.ts
25
server.ts
@@ -1,6 +1,7 @@
|
||||
// server.ts
|
||||
import express, { Request, Response, NextFunction } from 'express';
|
||||
import cookieParser from 'cookie-parser';
|
||||
import listEndpoints from 'express-list-endpoints';
|
||||
import { getPool } from './src/services/db/connection';
|
||||
|
||||
import passport from './src/routes/passport';
|
||||
@@ -51,11 +52,6 @@ app.use(express.urlencoded({ limit: '100mb', extended: true }));
|
||||
app.use(cookieParser()); // Middleware to parse cookies
|
||||
app.use(passport.initialize()); // Initialize Passport
|
||||
|
||||
// --- RAW REQUEST LOGGER ---
|
||||
app.use((req, res, next) => {
|
||||
console.log(`[RAW INCOMING REQUEST] Method: ${req.method}, URL: ${req.originalUrl}`);
|
||||
next();
|
||||
});
|
||||
|
||||
// --- Logging Middleware ---
|
||||
|
||||
@@ -127,24 +123,7 @@ 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.table(listEndpoints(app));
|
||||
console.log('-----------------------------');
|
||||
// --- END ROUTE DEBUGGING ---
|
||||
Reference in New Issue
Block a user