Create .middlewares() method to mount corresponding set of middlewares

This commit is contained in:
Daniel García Aubert
2018-05-11 13:38:51 +02:00
parent 33af2d37b3
commit 1cfeda8fe5
@@ -31,8 +31,11 @@ module.exports = class AttributesLayergroupController {
}
register (mapRouter) {
mapRouter.get(
`/:token/:layer/attributes/:fid`,
mapRouter.get('/:token/:layer/attributes/:fid', this.middlewares());
}
middlewares () {
return [
layergroupToken(),
credentials(),
authorize(this.authBackend),
@@ -50,7 +53,7 @@ module.exports = class AttributesLayergroupController {
cacheChannelHeader(),
surrogateKeyHeader({ surrogateKeysCache: this.surrogateKeysCache }),
lastModifiedHeader()
);
];
}
};