Use template strings

This commit is contained in:
Daniel García Aubert
2018-03-14 17:33:54 +01:00
parent f078713d28
commit 04146f897d

View File

@@ -41,8 +41,10 @@ function NamedMapsController(prepareContext, namedMapProviderCache, tileBackend,
module.exports = NamedMapsController;
NamedMapsController.prototype.register = function(app) {
const { base_url_mapconfig, base_url_templated } = app;
app.get(
app.base_url_templated + '/:template_id/:layer/:z/:x/:y.(:format)',
`${base_url_templated}/:template_id/:layer/:z/:x/:y.(:format)`,
cors(),
userMiddleware(),
this.prepareContext,
@@ -65,7 +67,7 @@ NamedMapsController.prototype.register = function(app) {
);
app.get(
app.base_url_mapconfig + '/static/named/:template_id/:width/:height.:format',
`${base_url_mapconfig}/static/named/:template_id/:width/:height.:format`,
cors(),
userMiddleware(),
allowQueryParams(['layer', 'zoom', 'lon', 'lat', 'bbox']),