@ladjs/api 11.0.5 → 12.0.0
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.
- package/index.js +10 -10
- package/package.json +5 -5
package/index.js
CHANGED
|
@@ -107,16 +107,6 @@ class API {
|
|
|
107
107
|
// Basic auth
|
|
108
108
|
if (this.config.auth) app.use(auth(this.config.auth));
|
|
109
109
|
|
|
110
|
-
// Rate limiting
|
|
111
|
-
if (this.client && this.config.rateLimit)
|
|
112
|
-
app.use(
|
|
113
|
-
ratelimit({
|
|
114
|
-
...this.config.rateLimit,
|
|
115
|
-
db: this.client,
|
|
116
|
-
logger: this.logger
|
|
117
|
-
})
|
|
118
|
-
);
|
|
119
|
-
|
|
120
110
|
// Remove trailing slashes
|
|
121
111
|
app.use(removeTrailingSlashes());
|
|
122
112
|
|
|
@@ -148,6 +138,16 @@ class API {
|
|
|
148
138
|
// Passport
|
|
149
139
|
if (this.passport) app.use(this.passport.initialize());
|
|
150
140
|
|
|
141
|
+
// Rate limiting
|
|
142
|
+
if (this.client && this.config.rateLimit)
|
|
143
|
+
app.use(
|
|
144
|
+
ratelimit({
|
|
145
|
+
...this.config.rateLimit,
|
|
146
|
+
db: this.client,
|
|
147
|
+
logger: this.logger
|
|
148
|
+
})
|
|
149
|
+
);
|
|
150
|
+
|
|
151
151
|
// Store the user's last ip address in the background
|
|
152
152
|
if (this.config.storeIPAddress) {
|
|
153
153
|
const storeIPAddress = new StoreIPAddress({
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ladjs/api",
|
|
3
3
|
"description": "API server for Lad",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "12.0.0",
|
|
5
5
|
"author": "Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com/)",
|
|
6
6
|
"bugs": {
|
|
7
7
|
"url": "https://github.com/ladjs/api/issues",
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com/)"
|
|
12
12
|
],
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@koa/router": "^
|
|
15
|
-
"@ladjs/i18n": "^
|
|
14
|
+
"@koa/router": "^11.0.1",
|
|
15
|
+
"@ladjs/i18n": "^8.0.1",
|
|
16
16
|
"@ladjs/koa-simple-ratelimit": "^4.0.1",
|
|
17
17
|
"@ladjs/passport": "^5.0.3",
|
|
18
18
|
"@ladjs/redis": "^1.0.7",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"koa": "^2.13.4",
|
|
26
26
|
"koa-404-handler": "^0.1.0",
|
|
27
27
|
"koa-basic-auth": "^4.0.0",
|
|
28
|
-
"koa-better-error-handler": "^10.0.
|
|
28
|
+
"koa-better-error-handler": "^10.0.6",
|
|
29
29
|
"koa-better-timeout": "^0.0.6",
|
|
30
30
|
"koa-bodyparser": "^4.3.0",
|
|
31
31
|
"koa-compress": "^5.1.0",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"ioredis": "^5.1.0",
|
|
51
51
|
"ioredis-mock": "^8.2.2",
|
|
52
52
|
"lint-staged": "13.0.3",
|
|
53
|
-
"mongoose": "^6.4.
|
|
53
|
+
"mongoose": "^6.4.3",
|
|
54
54
|
"nyc": "^15.1.0",
|
|
55
55
|
"remark-cli": "^11.0.0",
|
|
56
56
|
"remark-preset-github": "^4.0.4",
|