@ladjs/api 9.0.0 → 9.0.1

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/index.js +7 -7
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -44,6 +44,12 @@ class API {
44
44
  // initialize the app
45
45
  const app = new Koa();
46
46
 
47
+ // only trust proxy if enabled
48
+ app.proxy = boolean(process.env.TRUST_PROXY);
49
+
50
+ // specify that this is our api (used by error handler)
51
+ app.context.api = true;
52
+
47
53
  // initialize cabin
48
54
  this.logger = _.isPlainObject(this.config.logger)
49
55
  ? new Cabin(this.config.logger)
@@ -78,13 +84,7 @@ class API {
78
84
  });
79
85
 
80
86
  // override koa's undocumented error handler
81
- app.context.onerror = errorHandler(false, this.logger);
82
-
83
- // only trust proxy if enabled
84
- app.proxy = boolean(process.env.TRUST_PROXY);
85
-
86
- // specify that this is our api (used by error handler)
87
- app.context.api = true;
87
+ app.context.onerror = errorHandler(false);
88
88
 
89
89
  // adds request received hrtime and date symbols to request object
90
90
  // (which is used by Cabin internally to add `request.timestamp` to logs
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ladjs/api",
3
3
  "description": "API server for Lad",
4
- "version": "9.0.0",
4
+ "version": "9.0.1",
5
5
  "author": "Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com/)",
6
6
  "ava": {
7
7
  "failFast": true,
@@ -23,6 +23,7 @@
23
23
  "@koa/router": "^10.1.1",
24
24
  "@ladjs/i18n": "^7.2.6",
25
25
  "@ladjs/koa-simple-ratelimit": "^3.0.0",
26
+ "@ladjs/passport": "^5.0.0",
26
27
  "@ladjs/redis": "^1.0.7",
27
28
  "@ladjs/shared-config": "^7.0.3",
28
29
  "@ladjs/store-ip-address": "^0.0.7",
@@ -51,7 +52,6 @@
51
52
  "devDependencies": {
52
53
  "@commitlint/cli": "^17.0.2",
53
54
  "@commitlint/config-conventional": "^17.0.2",
54
- "@ladjs/passport": "^5.0.0",
55
55
  "ava": "^4.3.0",
56
56
  "codecov": "^3.8.3",
57
57
  "cross-env": "^7.0.3",