Skip to main content

requestId

Functions

<dl> <dt><a href="#getRequestId">getRequestId()</a></dt> <dd><p>Generate or extract request ID Uses X-Request-Id header if provided, otherwise generates UUID</p> </dd> <dt><a href="#requestIdMiddleware">requestIdMiddleware()</a></dt> <dd><p>Express middleware to add request ID to request and response Also adds timing information</p> </dd> <dt><a href="#reqLog">reqLog()</a></dt> <dd><p>Create request-scoped logger with request ID Usage: const log = reqLog(req);</p> </dd> </dl>

<a name="getRequestId"></a>

getRequestId()

Generate or extract request ID Uses X-Request-Id header if provided, otherwise generates UUID

Kind: global function
<a name="requestIdMiddleware"></a>

requestIdMiddleware()

Express middleware to add request ID to request and response Also adds timing information

Kind: global function
<a name="reqLog"></a>

reqLog()

Create request-scoped logger with request ID Usage: const log = reqLog(req);

Kind: global function