An open API service indexing awesome lists of open source software.

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

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
```