Add request/response logging middleware to enhance auditing and debugging
All checks were successful
Build & Push Docker Image / build (push) Successful in 6m25s

This commit is contained in:
2026-02-28 20:43:18 +01:00
parent 1cff066c17
commit 8e18149ad1
2 changed files with 133 additions and 0 deletions

View File

@@ -3,6 +3,7 @@ import express from 'express';
import cors from 'cors';
import path from 'path';
import { fileURLToPath } from 'url';
import requestResponseLogger from './middleware/logging.js';
import { initDatabase } from './config/database.js';
import { initMailer } from './config/mailer.js';
import authRoutes from './routes/auth.js';
@@ -31,6 +32,8 @@ const corsOptions = process.env.APP_URL
: {};
app.use(cors(corsOptions));
app.use(express.json());
// Request/Response logging (filters sensitive fields)
app.use(requestResponseLogger);
// Initialize database & start server
async function start() {