express-required-cuid provides a simple express/connect middleware for creating a new cuid for each request and appending an x-request-id
header to the request and adding the requestId
and id
property to the request-object.
Just like above:
import requestCuid from 'express-request-cuid';
import express from 'express';
const app = express();
app.use(requestCuid());
Import the module and use it. It works with CJS require
as well. For any additional configuration, please open a new issue
(Types are included)