micronodelib 1.0.7 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +9 -5
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -20,22 +20,26 @@ yarn add micronodelib
20
20
 
21
21
  ## Usage
22
22
 
23
- ```shell
23
+ ```javascript
24
24
  import express, {Application} from "express";
25
25
  import {Logger, httpContextMiddleware, requestLogMiddleware} from "micronodelib";
26
26
  const app: Application = express();
27
27
 
28
- # Enable request context
28
+ // Optional, if you want to override default console log
29
+ console.log = Logger.info
30
+ console.error = Logger.error
31
+
32
+ // Enable request context
29
33
  app.use(httpContextMiddleware());
30
34
 
31
- # Enable http request log
35
+ // Enable http request log
32
36
  app.use(requestLogMiddleware({
33
- # Ignore request log for specific routes
37
+ // Ignore request log for specific routes
34
38
  ignoreRoutes: ["/actuator/health"]
35
39
  }));
36
40
 
37
41
  app.listen(3000, () => {
38
- # Using standard log level: debug, info, warn, error
42
+ // Using standard log level: debug, info, warn, error
39
43
  Logger.info('App started');
40
44
  })
41
45
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "micronodelib",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "Common core for NodeJs project",
5
5
  "author": "Thang Bui",
6
6
  "license": "MIT",