🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@nioh/trace

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nioh/trace

koa request id

latest
npmnpm
Version
1.0.0
Version published
Weekly downloads
2
-50%
Maintainers
1
Weekly downloads
 
Created
Source

中间件: request-id

安装

Install with npm

npm i @server/request-id --registry=http://npm.zkh360.com

说明

生成请求UID,绑定到KOA上下文state中,日志使用

使用

import * as Koa from 'koa'
import * as requestId from '@server/request-id'

const app = new Koa()

app.use(requestId())

app.use(ctx => {
  const id = ctx.state.requestId
  ctx.body = {
    id
  }
})

app.listen(3000)

ChangeLog

Tests

npm test

License

2019@ZKH-FE

FAQs

Package last updated on 12 Nov 2020

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