@ladjs/api 14.1.13 → 14.1.15
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 +3 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -44,6 +44,7 @@ class API {
|
|
|
44
44
|
// eslint-disable-next-line complexity
|
|
45
45
|
constructor(config, Users) {
|
|
46
46
|
this.config = {
|
|
47
|
+
removeTrailingSlashes: true,
|
|
47
48
|
...sharedConfig('API'),
|
|
48
49
|
...config
|
|
49
50
|
};
|
|
@@ -120,7 +121,7 @@ class API {
|
|
|
120
121
|
if (this.config.auth) app.use(auth(this.config.auth));
|
|
121
122
|
|
|
122
123
|
// Remove trailing slashes
|
|
123
|
-
app.use(removeTrailingSlashes);
|
|
124
|
+
if (this.config.removeTrailingSlashes) app.use(removeTrailingSlashes);
|
|
124
125
|
|
|
125
126
|
// I18n
|
|
126
127
|
if (this.config.i18n) {
|
|
@@ -197,7 +198,7 @@ class API {
|
|
|
197
198
|
|
|
198
199
|
// Allow before hooks to get setup
|
|
199
200
|
if (_.isFunction(this.config.hookBeforeRoutes))
|
|
200
|
-
this.config.hookBeforeRoutes(app);
|
|
201
|
+
this.config.hookBeforeRoutes(app, this.config);
|
|
201
202
|
|
|
202
203
|
// Mount the app's defined and nested routes
|
|
203
204
|
if (this.config.routes) {
|
package/package.json
CHANGED