@datreeio/koa-requestid

A koa middleware to generate and forward request ids between services

Stats

stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
01May 15, 2019Jan 31, 2018Minified + gzip package size for @datreeio/koa-requestid in KB

Readme

koa-requestid Build Status

A koa middleware to generate and forward request ids between services

Install

npm install @datreeio/koa-requestid

Test

npm test

usage

basic usage

const requestId = require('@datreeio/koa-requestid')
const koa = require('koa')
const app = new koa()
app.use(
  requestId({
    headerKey: 'testKey'
  })
)

custom id generator usage

const requestId = require('@datreeio/koa-requestid')
const koa = require('koa')
const app = new koa()

app.use(
  requestId({
    headerKey: 'testKey',
    idGenerator: someIdGenerator
  })
)

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.