UNPKG

@gov-cy/govcy-express-services

Version:

An Express-based system that dynamically renders services using @gov-cy/govcy-frontend-renderer and posts data to a submission API.

16 lines (12 loc) 391 B
import { logger } from '../utils/govcyLogger.mjs'; /** * Middleware to log incoming requests. */ export function requestLogger(req, res, next) { const timestamp = new Date().toISOString(); logger.info(`[${timestamp}]`, req.method, req.url); if (req.session) { logger.info(`Session ID: ${req.sessionID}`); } next(); // Pass control to the next middleware }