🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

koa-x-request-id

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koa-x-request-id

Generates a unique Request ID for every incoming HTTP request

latest
Source
npmnpm
Version
2.0.0
Version published
Maintainers
1
Created
Source

koa-x-request-id

Generates a unique Request ID for every incoming HTTP request. This unique ID is then passed to your application as an HTTP header called X-Request-Id.

NPM version Build status Test coverage License Dependency status

Install

$ npm install --save koa-x-request-id

Usage

=2.x, working with koa-v2

app.use(xRequestId({ key, noHyphen, inject }, [app]))
const Koa = require('koa')
const xRequestId = require('koa-x-request-id')
const app = new Koa()

// key defaults to `X-Request-Id`
// if `noHyphen = true`, generates 32 uuid, no hyphen `-`.
// if `inject = true`, `ctx.id = uuid`
app.use(xRequestId({key, noHyphen, inject}, app))

=1.x

app.use(xRequestId(app, { key, noHyphen, inject }))
var koa = require('koa')
var xRequestId = require('koa-x-request-id')
var app = koa()

// key defaults to `X-Request-Id`
// if `noHyphen = true`, generates 32 uuid, no hyphen `-`.
// if `inject = true`, `ctx.id = uuid`
app.use(xRequestId({key, noHyphen, inject}, app))

Keywords

request-id

FAQs

Package last updated on 24 Nov 2015

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