项目作者: PDMLab

项目描述 :
Shows the usage of express-correlation-id package with express controllers and their dependencies
高级语言: JavaScript
项目地址: git://github.com/PDMLab/express-correlationid-sample.git
创建时间: 2018-06-13T19:43:44Z
项目社区:https://github.com/PDMLab/express-correlationid-sample

开源协议:MIT License

下载


Node.js express correlation id sample

This sample shows the usage of express-correlation-id package with express controllers having dependencies being called sync or async including error handling.

Running the sample

npm start:

  1. server listening on port 3000

http get localhost:3000/api1/hello:

  1. API 1 controller correlation id: 03b37b23-6451-4c57-8722-cef475d0c914
  2. API 1 handler correlation id: 03b37b23-6451-4c57-8722-cef475d0c914
  3. API 1 sync dependency correlation id: 03b37b23-6451-4c57-8722-cef475d0c914
  4. API 1 async dependency correlation id: 03b37b23-6451-4c57-8722-cef475d0c914

http get localhost:3000/api1/hellofail:

  1. API 1 controller fail correlation id: a13b0f70-5bdb-4ede-90b3-cc1de33efdd9
  2. API 1 fail handler correlation id: a13b0f70-5bdb-4ede-90b3-cc1de33efdd9
  3. API 1 sync dependency correlation id: a13b0f70-5bdb-4ede-90b3-cc1de33efdd9
  4. API 1 async dependency correlation id: a13b0f70-5bdb-4ede-90b3-cc1de33efdd9
  5. API 1 fail handler catch correlation id: a13b0f70-5bdb-4ede-90b3-cc1de33efdd9