Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

express-pass-id

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-pass-id

Simple middleware for passing request id

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
20
increased by150%
Maintainers
1
Weekly downloads
 
Created
Source

#Express-Pass-Id

Simple express middleware module, inspired by express-request-id.

It allows passing prefixes for unique request IDs and using custom headers (because x-request-id is often already used).

##Installation npm install express-pass-id

##Usage config.json

{
  "prefix": "myService1",
  "header": "x-my-id"
}

express app file

var 
    express       = require('express'),
    app           = express(),
    config        = require('./config.json'),
    expressPassId = require('express-pass-id.js')(config),
    rp = require('request-promise');

app.use(expressPassId);

app.post('/login', function (req, res) {
  console.log('Processing route /login, id '+req.id); //print custom ID
  
  var options = {
      uri: 'https://google.com',
      headers: req.passHeaders //Here we pass our custom header
  };
   
  rp(options)
    //....
});

FAQs

Package last updated on 12 Jan 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc