ShiftWise API Docs
    Preparing search index...

    Module middleware/logger

    HTTP request logger middleware with colour-coded output.

    Logs each completed request with method, path, status code, and duration. Output is colour-coded by HTTP method and status code for fast visual scanning:

    • Methods: GET (blue), POST (green), DELETE (red), others (yellow)
    • Status: 2xx (green), 3xx (cyan), 4xx (yellow), 5xx (red)

    The logger attaches to the res.on('finish') event so duration includes the full round-trip including response serialisation.

    // Output:
    // POST /api/auth/login 200 43ms
    // GET /api/workspaces/abc123/employees 200 12ms
    // POST /api/auth/refresh 401 3ms

    Functions

    requestLogger