Skip to content
connect / express middleware for accessing/creating http request identifiers
JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.gitignore
.npmignore
.travis.yml
README.md
index.js
package.json
test.js

README.md

Connect Request ID

Does one thing (but might not do that particuarly well). A connect middleware that creates unique ID's for each requests using node-uuid or a supplied HTTP header. Heavily (if not completely) based upon restify's implementation

This module has lots of room for being more configurable so if you want to do that go for it, PR's welcome.

Usage

npm install [--save] connect-request-id

    var requestId = require('connect-request-id');
    var connect = require('connect');

    var app = connect();
    app.use(requestId())

If the inbound request has the header request-id it will set the property id of the request to whatever the value of the header is, as long as the property hasn't already been defined.

Tests

The tests are completly whacky, I was super tired when I wrote this and have honestly no idea quite how they ended up like they did.

Would be nice to beef them up a bit to actually test express framework too.

Something went wrong with that request. Please try again.