Create .middlwares() to return a set of middlewares to be mounted

This commit is contained in:
Daniel García Aubert 2018-05-11 12:38:52 +02:00
parent d86a839265
commit 07dec2e641

View File

@ -16,8 +16,11 @@ module.exports = class AnalysisLayergroupController {
}
register (mapRouter) {
mapRouter.get(
`/:token/analysis/node/:nodeId`,
mapRouter.get('/:token/analysis/node/:nodeId', this.middlewares());
}
middlewares () {
return [
layergroupToken(),
credentials(),
authorize(this.authBackend),
@ -25,7 +28,7 @@ module.exports = class AnalysisLayergroupController {
rateLimit(this.userLimitsBackend, RATE_LIMIT_ENDPOINTS_GROUPS.ANALYSIS),
cleanUpQueryParams(),
analysisNodeStatus(this.analysisStatusBackend)
);
];
}
};