diff --git a/lib/cartodb/controllers/named_maps_admin.js b/lib/cartodb/controllers/named_maps_admin.js index 6f991728..c28a2746 100644 --- a/lib/cartodb/controllers/named_maps_admin.js +++ b/lib/cartodb/controllers/named_maps_admin.js @@ -16,8 +16,10 @@ function NamedMapsAdminController(authApi, templateMaps) { module.exports = NamedMapsAdminController; NamedMapsAdminController.prototype.register = function (app) { + const prefix = app.base_url_templated; + app.post( - app.base_url_templated + '/', + `${prefix}/`, cors(), userMiddleware, this.checkContentType('POST', 'POST TEMPLATE'), @@ -26,7 +28,7 @@ NamedMapsAdminController.prototype.register = function (app) { ); app.put( - app.base_url_templated + '/:template_id', + `${prefix}/:template_id`, cors(), userMiddleware, this.checkContentType('PUT', 'PUT TEMPLATE'), @@ -35,7 +37,7 @@ NamedMapsAdminController.prototype.register = function (app) { ); app.get( - app.base_url_templated + '/:template_id', + `${prefix}/:template_id`, cors(), userMiddleware, this.authorizedByAPIKey('get', 'GET TEMPLATE'), @@ -43,7 +45,7 @@ NamedMapsAdminController.prototype.register = function (app) { ); app.delete( - app.base_url_templated + '/:template_id', + `${prefix}/:template_id`, cors(), userMiddleware, this.authorizedByAPIKey('delete', 'DELETE TEMPLATE'), @@ -51,7 +53,7 @@ NamedMapsAdminController.prototype.register = function (app) { ); app.get( - app.base_url_templated + '/', + `${prefix}/`, cors(), userMiddleware, this.authorizedByAPIKey('list', 'GET TEMPLATE LIST'), @@ -59,7 +61,7 @@ NamedMapsAdminController.prototype.register = function (app) { ); app.options( - app.base_url_templated + '/:template_id', + `${prefix}/:template_id`, cors('Content-Type') ); };