https://github.com/pdmlab/express-correlationid-sample
Shows the usage of express-correlation-id package with express controllers and their dependencies
https://github.com/pdmlab/express-correlationid-sample
expressjs http httpserver microservices nodejs
Last synced: about 1 month ago
JSON representation
Shows the usage of express-correlation-id package with express controllers and their dependencies
- Host: GitHub
- URL: https://github.com/pdmlab/express-correlationid-sample
- Owner: PDMLab
- License: mit
- Created: 2018-06-13T19:43:44.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2019-04-08T21:12:50.000Z (about 7 years ago)
- Last Synced: 2026-04-05T21:36:10.018Z (about 1 month ago)
- Topics: expressjs, http, httpserver, microservices, nodejs
- Language: JavaScript
- Homepage:
- Size: 46.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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`:
```
server listening on port 3000
```
`http get localhost:3000/api1/hello`:
```
API 1 controller correlation id: 03b37b23-6451-4c57-8722-cef475d0c914
API 1 handler correlation id: 03b37b23-6451-4c57-8722-cef475d0c914
API 1 sync dependency correlation id: 03b37b23-6451-4c57-8722-cef475d0c914
API 1 async dependency correlation id: 03b37b23-6451-4c57-8722-cef475d0c914
```
`http get localhost:3000/api1/hellofail`:
```
API 1 controller fail correlation id: a13b0f70-5bdb-4ede-90b3-cc1de33efdd9
API 1 fail handler correlation id: a13b0f70-5bdb-4ede-90b3-cc1de33efdd9
API 1 sync dependency correlation id: a13b0f70-5bdb-4ede-90b3-cc1de33efdd9
API 1 async dependency correlation id: a13b0f70-5bdb-4ede-90b3-cc1de33efdd9
API 1 fail handler catch correlation id: a13b0f70-5bdb-4ede-90b3-cc1de33efdd9
```