micronodelib 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -26,7 +26,7 @@ import {Logger, httpContextMiddleware, requestLogMiddleware} from "micronodelib"
26
26
  const app: Application = express();
27
27
 
28
28
  # Enable request context
29
- app.use(httpContextMiddleware);
29
+ app.use(httpContextMiddleware());
30
30
 
31
31
  # Enable http request log
32
32
  app.use(requestLogMiddleware({
@@ -1,2 +1,2 @@
1
1
  import { NextFunction, Request, Response } from "express";
2
- export declare const httpContextMiddleware: ((req: Request, res: Response, next: NextFunction) => void)[];
2
+ export declare const httpContextMiddleware: () => ((req: Request, res: Response, next: NextFunction) => void)[];
@@ -12,7 +12,10 @@ const requestIdMiddleware = (req, res, next) => {
12
12
  (0, express_http_context_1.set)("reqId", requestId);
13
13
  next();
14
14
  };
15
- exports.httpContextMiddleware = [
16
- express_http_context_1.middleware,
17
- requestIdMiddleware,
18
- ];
15
+ const httpContextMiddleware = function () {
16
+ return [
17
+ express_http_context_1.middleware,
18
+ requestIdMiddleware,
19
+ ];
20
+ };
21
+ exports.httpContextMiddleware = httpContextMiddleware;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "micronodelib",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Common core for NodeJs project",
5
5
  "author": "Thang Bui",
6
6
  "license": "MIT",