1.1.0 • Published 8 years ago

hapi-request-id v1.1.0

Weekly downloads
15
License
MIT
Repository
github
Last release
8 years ago

Hapi Request ID

This module is a plugin for Hapi.js that sets the id property of each Hapi.js request object on a server to the value of that request's X-Request-ID header. This makes it easier to corrolate requests across multiple Hapi applications and things like the Heroku routing stack.

Usage

const Hapi      = require('hapi');
const RequestID = require('hapi-request-id');
const server    = new Hapi.Server();

server.register([
  RequestID
], function(err) {
  /* etc. */
});

// You can also specify any arbitrary header to set as the request ID
server.register({
  register: RequestID,
  options: { header: 'x-my-custom-id-header' }
}, function(err) {
  /* etc. */
});