feat: add request header logging to dev and prod servers
All checks were successful
Build and Push Presejpacky Docker Image / build-and-push (push) Successful in 7s

This commit is contained in:
2026-06-08 00:05:06 +02:00
parent c7c6bed56c
commit afd29c0a23
2 changed files with 15 additions and 1 deletions

View File

@@ -9,6 +9,13 @@ const __dirname = path.dirname(__filename);
const app = express();
const PORT = process.env.PORT || 3000;
// Log all incoming request methods, URLs, and headers
app.use((req, res, next) => {
console.log(`[Express Request] ${req.method} ${req.url}`);
console.log('Headers:', JSON.stringify(req.headers, null, 2));
next();
});
// Middleware to strip base path prefix from request headers if present
app.use((req, res, next) => {
const prefix = (req.headers['x-forwarded-prefix'] as string) || (req.headers['x-base-path'] as string) || '';