hapi-request-id

1.1.0 • Public • Published

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. */
});
 

Readme

Keywords

Package Sidebar

Install

npm i hapi-request-id

Weekly Downloads

4

Version

1.1.0

License

MIT

Last publish

Collaborators

  • jclem