|
4 | 4 |
|
5 | 5 | [](https://travis-ci.org/zhujun24/http-request-context)
|
6 | 6 | [](https://coveralls.io/github/zhujun24/http-request-context?branch=master)
|
| 7 | +[](https://snyk.io//test/github/zhujun24/http-request-context?targetFile=package.json) |
| 8 | +[](https://app.fossa.com/projects/git%2Bgithub.com%2Fzhujun24%2Fhttp-request-context?ref=badge_shield) |
7 | 9 | [](https://www.npmjs.com/package/http-request-context)
|
| 10 | + |
8 | 11 | [](https://www.npmjs.com/package/http-request-context)
|
9 | 12 | [](https://www.npmjs.com/package/http-request-context)
|
10 | 13 | [](https://www.npmjs.com/package/http-request-context)
|
@@ -42,13 +45,15 @@ Parameter configuration must be require before, but normally no config are requi
|
42 | 45 | - `httpRequestContext.get(key)` Get the `[key]` attribute of the context.
|
43 | 46 | - `httpRequestContext.get()` Gets an object containing all context properties.
|
44 | 47 |
|
45 |
| -## Example |
| 48 | +## How to Use |
46 | 49 |
|
47 |
| -see [example](https://github.com/zhujun24/http-request-context/tree/master/example) |
| 50 | +see [example](https://github.com/zhujun24/http-request-context/tree/master/example) here. |
48 | 51 |
|
49 |
| -## How to Use |
| 52 | +### Install |
50 | 53 |
|
51 |
| -Install: `npm install http-request-context --save` |
| 54 | +```npm |
| 55 | +npm install http-request-context --save |
| 56 | +``` |
52 | 57 |
|
53 | 58 | ### Express
|
54 | 59 |
|
@@ -123,6 +128,10 @@ httpRequestContext.get('foo') // 'bar'
|
123 | 128 |
|
124 | 129 | If you init mysql connect before http server start, you may get context undefined in mysql query callback scope.
|
125 | 130 |
|
| 131 | +[googleapis/cloud-trace-nodejs #946](https://github.com/googleapis/cloud-trace-nodejs/issues/946) |
| 132 | + |
| 133 | +[nodejs/node #22360](https://github.com/nodejs/node/issues/22360) |
| 134 | + |
126 | 135 | ```js
|
127 | 136 | mysqlConnection.query('SELECT * FROM table', (error, results, fields) => {
|
128 | 137 | httpRequestContext.get('foo') // undefined
|
|
0 commit comments