Draft: be able to inject middlewares from configuration

This commit is contained in:
Daniel García Aubert
2019-09-30 19:18:36 +02:00
parent b881bec668
commit 9cfaf6eefc
6 changed files with 44 additions and 8 deletions
+11 -1
View File
@@ -22,12 +22,22 @@ var config = {
'/api/v1',
'/user/:user/api/v1',
],
// Attach middlewares at the begining of the req/res cycle
// to perform custom operations.
middlewares: [
function noop () {
return function noopMiddleware (req, res, next) {
next();
}
}
],
// Base url for the Detached Maps API
// "/api/v1/map" is the new API,
map: {
paths: [
'/map',
]
],
middlewares: []
},
// Base url for the Templated Maps API
// "/api/v1/map/named" is the new API,