Create .middlewares() method to build midlleware stack to perform request

This commit is contained in:
Daniel García Aubert
2018-05-11 16:26:05 +02:00
parent 3905ed796e
commit c6babc7dc4

View File

@@ -30,8 +30,11 @@ module.exports = class TileTemplateController {
}
register (templateRouter) {
templateRouter.get(
`/:template_id/:layer/:z/:x/:y.(:format)`,
templateRouter.get('/:template_id/:layer/:z/:x/:y.(:format)', this.middlewares());
}
middlewares () {
return [
coordinates(),
credentials(),
authorize(this.authBackend),
@@ -52,7 +55,7 @@ module.exports = class TileTemplateController {
surrogateKeyHeader({ surrogateKeysCache: this.surrogateKeysCache }),
lastModifiedHeader(),
vectorError()
);
];
}
};