request-id
Express.js request-id middleware.
Allows you to identify client requests within non-sequential logs by adding a response header of X-Request-Id
.
Allows setting value via query parameter or request header.
Installation
$ npm install cc-request-id
Running the tests
$ npm install
$ mocha
API
var requestId =
requestId(options)
Create new request-id middleware.
options
See request-id options. Exception: Default value generator function: uuid-1345.v4fast
Example
var express = var app = var requestId = var bodyParser = appappappapp
test it:
curl http://localhost:8080/test -I | grep X-Request-Id
outputs:
X-Request-Id: 98401c07-e91a-40ca-813e-5407970de407