Create .middlewares() method to return the middlewares to process the request
This commit is contained in:
@@ -46,10 +46,14 @@ module.exports = class TileLayergroupController {
|
||||
const not = (val) => `(?!${val})([^\/]+?)`;
|
||||
|
||||
mapRouter.get([
|
||||
`/:token/:z/:x/:y@:scale_factor?x.:format`,
|
||||
`/:token/:z/:x/:y.:format`,
|
||||
`/:token${not('static')}/:layer/:z/:x/:y.(:format)`
|
||||
],
|
||||
`/:token/:z/:x/:y@:scale_factor?x.:format`,
|
||||
`/:token/:z/:x/:y.:format`,
|
||||
`/:token${not('static')}/:layer/:z/:x/:y.(:format)`
|
||||
], this.middlewares());
|
||||
}
|
||||
|
||||
middlewares () {
|
||||
return [
|
||||
layergroupToken(),
|
||||
coordinates(),
|
||||
credentials(),
|
||||
@@ -72,7 +76,7 @@ module.exports = class TileLayergroupController {
|
||||
incrementErrorMetrics(global.statsClient),
|
||||
tileError(),
|
||||
vectorError()
|
||||
);
|
||||
];
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user