axe-api 1.4.7 → 1.4.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.
- package/build/src/Server.js +5 -5
- package/package.json +1 -1
package/build/src/Server.js
CHANGED
|
@@ -142,6 +142,11 @@ class Server {
|
|
|
142
142
|
var _a;
|
|
143
143
|
const app = yield Services_1.IoCService.use("App");
|
|
144
144
|
const api = Services_1.APIService.getInstance();
|
|
145
|
+
// Rate limitting should be added before init() functions
|
|
146
|
+
if ((_a = api.config.rateLimit) === null || _a === void 0 ? void 0 : _a.enabled) {
|
|
147
|
+
Services_1.LogService.debug("New middleware: rateLimit()");
|
|
148
|
+
app.use(RateLimit_1.default);
|
|
149
|
+
}
|
|
145
150
|
// Adding the default handler for auto-created routes
|
|
146
151
|
app.use(RequestHandler_1.default);
|
|
147
152
|
// Setting the error handler
|
|
@@ -155,11 +160,6 @@ class Server {
|
|
|
155
160
|
app.get("/docs", DocsHandler_1.default);
|
|
156
161
|
app.get("/routes", RoutesHandler_1.default);
|
|
157
162
|
}
|
|
158
|
-
// Rate limitting should be added after init() functions.
|
|
159
|
-
if ((_a = api.config.rateLimit) === null || _a === void 0 ? void 0 : _a.enabled) {
|
|
160
|
-
Services_1.LogService.debug("New middleware: rateLimit()");
|
|
161
|
-
app.use(RateLimit_1.default);
|
|
162
|
-
}
|
|
163
163
|
server.listen(api.config.port);
|
|
164
164
|
Services_1.LogService.axe(`Axe API listens requests on http://localhost:${api.config.port}`);
|
|
165
165
|
});
|