Rename base paths
This commit is contained in:
parent
5ede6c3021
commit
071a5a4bdf
@ -16,8 +16,10 @@ function AnalysesController(pgConnection, authApi) {
|
|||||||
module.exports = AnalysesController;
|
module.exports = AnalysesController;
|
||||||
|
|
||||||
AnalysesController.prototype.register = function (app) {
|
AnalysesController.prototype.register = function (app) {
|
||||||
|
const { base_url_mapconfig: mapconfigBasePath } = app;
|
||||||
|
|
||||||
app.get(
|
app.get(
|
||||||
`${app.base_url_mapconfig}/analyses/catalog`,
|
`${mapconfigBasePath}/analyses/catalog`,
|
||||||
cors(),
|
cors(),
|
||||||
userMiddleware(),
|
userMiddleware(),
|
||||||
locals(),
|
locals(),
|
||||||
|
@ -53,10 +53,10 @@ function LayergroupController(pgConnection, mapStore, tileBackend, previewBacken
|
|||||||
module.exports = LayergroupController;
|
module.exports = LayergroupController;
|
||||||
|
|
||||||
LayergroupController.prototype.register = function(app) {
|
LayergroupController.prototype.register = function(app) {
|
||||||
const { base_url_mapconfig: basePath } = app;
|
const { base_url_mapconfig: mapconfigBasePath } = app;
|
||||||
|
|
||||||
app.get(
|
app.get(
|
||||||
`${basePath}/:token/:z/:x/:y@:scale_factor?x.:format`,
|
`${mapconfigBasePath}/:token/:z/:x/:y@:scale_factor?x.:format`,
|
||||||
cors(),
|
cors(),
|
||||||
userMiddleware(),
|
userMiddleware(),
|
||||||
locals(),
|
locals(),
|
||||||
@ -80,7 +80,7 @@ LayergroupController.prototype.register = function(app) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
app.get(
|
app.get(
|
||||||
`${basePath}/:token/:z/:x/:y.:format`,
|
`${mapconfigBasePath}/:token/:z/:x/:y.:format`,
|
||||||
cors(),
|
cors(),
|
||||||
userMiddleware(),
|
userMiddleware(),
|
||||||
locals(),
|
locals(),
|
||||||
@ -104,7 +104,7 @@ LayergroupController.prototype.register = function(app) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
app.get(
|
app.get(
|
||||||
`${basePath}/:token/:layer/:z/:x/:y.(:format)`,
|
`${mapconfigBasePath}/:token/:layer/:z/:x/:y.(:format)`,
|
||||||
distinguishLayergroupFromStaticRoute(),
|
distinguishLayergroupFromStaticRoute(),
|
||||||
cors(),
|
cors(),
|
||||||
userMiddleware(),
|
userMiddleware(),
|
||||||
@ -129,7 +129,7 @@ LayergroupController.prototype.register = function(app) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
app.get(
|
app.get(
|
||||||
`${basePath}/:token/:layer/attributes/:fid`,
|
`${mapconfigBasePath}/:token/:layer/attributes/:fid`,
|
||||||
cors(),
|
cors(),
|
||||||
userMiddleware(),
|
userMiddleware(),
|
||||||
locals(),
|
locals(),
|
||||||
@ -151,7 +151,7 @@ LayergroupController.prototype.register = function(app) {
|
|||||||
const forcedFormat = 'png';
|
const forcedFormat = 'png';
|
||||||
|
|
||||||
app.get(
|
app.get(
|
||||||
`${basePath}/static/center/:token/:z/:lat/:lng/:width/:height.:format`,
|
`${mapconfigBasePath}/static/center/:token/:z/:lat/:lng/:width/:height.:format`,
|
||||||
cors(),
|
cors(),
|
||||||
userMiddleware(),
|
userMiddleware(),
|
||||||
allowQueryParams(['layer']),
|
allowQueryParams(['layer']),
|
||||||
@ -172,7 +172,7 @@ LayergroupController.prototype.register = function(app) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
app.get(
|
app.get(
|
||||||
`${basePath}/static/bbox/:token/:west,:south,:east,:north/:width/:height.:format`,
|
`${mapconfigBasePath}/static/bbox/:token/:west,:south,:east,:north/:width/:height.:format`,
|
||||||
cors(),
|
cors(),
|
||||||
userMiddleware(),
|
userMiddleware(),
|
||||||
allowQueryParams(['layer']),
|
allowQueryParams(['layer']),
|
||||||
@ -211,7 +211,7 @@ LayergroupController.prototype.register = function(app) {
|
|||||||
];
|
];
|
||||||
|
|
||||||
app.get(
|
app.get(
|
||||||
`${basePath}/:token/dataview/:dataviewName`,
|
`${mapconfigBasePath}/:token/dataview/:dataviewName`,
|
||||||
cors(),
|
cors(),
|
||||||
userMiddleware(),
|
userMiddleware(),
|
||||||
allowQueryParams(allowedDataviewQueryParams),
|
allowQueryParams(allowedDataviewQueryParams),
|
||||||
@ -232,7 +232,7 @@ LayergroupController.prototype.register = function(app) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
app.get(
|
app.get(
|
||||||
`${basePath}/:token/:layer/widget/:dataviewName`,
|
`${mapconfigBasePath}/:token/:layer/widget/:dataviewName`,
|
||||||
cors(),
|
cors(),
|
||||||
userMiddleware(),
|
userMiddleware(),
|
||||||
allowQueryParams(allowedDataviewQueryParams),
|
allowQueryParams(allowedDataviewQueryParams),
|
||||||
@ -253,7 +253,7 @@ LayergroupController.prototype.register = function(app) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
app.get(
|
app.get(
|
||||||
`${basePath}/:token/dataview/:dataviewName/search`,
|
`${mapconfigBasePath}/:token/dataview/:dataviewName/search`,
|
||||||
cors(),
|
cors(),
|
||||||
userMiddleware(),
|
userMiddleware(),
|
||||||
allowQueryParams(allowedDataviewQueryParams),
|
allowQueryParams(allowedDataviewQueryParams),
|
||||||
@ -274,7 +274,7 @@ LayergroupController.prototype.register = function(app) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
app.get(
|
app.get(
|
||||||
`${basePath}/:token/:layer/widget/:dataviewName/search`,
|
`${mapconfigBasePath}/:token/:layer/widget/:dataviewName/search`,
|
||||||
cors(),
|
cors(),
|
||||||
userMiddleware(),
|
userMiddleware(),
|
||||||
allowQueryParams(allowedDataviewQueryParams),
|
allowQueryParams(allowedDataviewQueryParams),
|
||||||
@ -295,7 +295,7 @@ LayergroupController.prototype.register = function(app) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
app.get(
|
app.get(
|
||||||
`${basePath}/:token/analysis/node/:nodeId`,
|
`${mapconfigBasePath}/:token/analysis/node/:nodeId`,
|
||||||
cors(),
|
cors(),
|
||||||
userMiddleware(),
|
userMiddleware(),
|
||||||
locals(),
|
locals(),
|
||||||
|
@ -53,13 +53,15 @@ function MapController(pgConnection, templateMaps, mapBackend, metadataBackend,
|
|||||||
module.exports = MapController;
|
module.exports = MapController;
|
||||||
|
|
||||||
MapController.prototype.register = function(app) {
|
MapController.prototype.register = function(app) {
|
||||||
const { base_url_mapconfig, base_url_templated } = app;
|
const { base_url_mapconfig: mapconfigBasePath, base_url_templated: templateBasePath } = app;
|
||||||
const useTemplate = true;
|
const useTemplate = true;
|
||||||
|
|
||||||
app.get(base_url_mapconfig, this.composeCreateMapMiddleware());
|
app.get(mapconfigBasePath, this.composeCreateMapMiddleware());
|
||||||
app.post(base_url_mapconfig, this.composeCreateMapMiddleware());
|
app.post(mapconfigBasePath, this.composeCreateMapMiddleware());
|
||||||
app.get(`${base_url_templated}/:template_id/jsonp`, this.composeCreateMapMiddleware(useTemplate));
|
|
||||||
app.post(`${base_url_templated}/:template_id`, this.composeCreateMapMiddleware(useTemplate));
|
app.get(`${templateBasePath}/:template_id/jsonp`, this.composeCreateMapMiddleware(useTemplate));
|
||||||
|
app.post(`${templateBasePath}/:template_id`, this.composeCreateMapMiddleware(useTemplate));
|
||||||
|
|
||||||
app.options(app.base_url_mapconfig, cors('Content-Type'));
|
app.options(app.base_url_mapconfig, cors('Content-Type'));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -48,10 +48,10 @@ function NamedMapsController(namedMapProviderCache, tileBackend, previewBackend,
|
|||||||
module.exports = NamedMapsController;
|
module.exports = NamedMapsController;
|
||||||
|
|
||||||
NamedMapsController.prototype.register = function(app) {
|
NamedMapsController.prototype.register = function(app) {
|
||||||
const { base_url_mapconfig, base_url_templated } = app;
|
const { base_url_mapconfig: mapconfigBasePath, base_url_templated: templateBasePath } = app;
|
||||||
|
|
||||||
app.get(
|
app.get(
|
||||||
`${base_url_templated}/:template_id/:layer/:z/:x/:y.(:format)`,
|
`${templateBasePath}/:template_id/:layer/:z/:x/:y.(:format)`,
|
||||||
cors(),
|
cors(),
|
||||||
userMiddleware(),
|
userMiddleware(),
|
||||||
locals(),
|
locals(),
|
||||||
@ -79,7 +79,7 @@ NamedMapsController.prototype.register = function(app) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
app.get(
|
app.get(
|
||||||
`${base_url_mapconfig}/static/named/:template_id/:width/:height.:format`,
|
`${mapconfigBasePath}/static/named/:template_id/:width/:height.:format`,
|
||||||
cors(),
|
cors(),
|
||||||
userMiddleware(),
|
userMiddleware(),
|
||||||
allowQueryParams(['layer', 'zoom', 'lon', 'lat', 'bbox']),
|
allowQueryParams(['layer', 'zoom', 'lon', 'lat', 'bbox']),
|
||||||
|
@ -18,10 +18,10 @@ function NamedMapsAdminController(authApi, templateMaps) {
|
|||||||
module.exports = NamedMapsAdminController;
|
module.exports = NamedMapsAdminController;
|
||||||
|
|
||||||
NamedMapsAdminController.prototype.register = function (app) {
|
NamedMapsAdminController.prototype.register = function (app) {
|
||||||
const { base_url_templated } = app;
|
const { base_url_templated: templateBasePath } = app;
|
||||||
|
|
||||||
app.post(
|
app.post(
|
||||||
`${base_url_templated}/`,
|
`${templateBasePath}/`,
|
||||||
cors(),
|
cors(),
|
||||||
userMiddleware(),
|
userMiddleware(),
|
||||||
localsMiddleware(),
|
localsMiddleware(),
|
||||||
@ -33,7 +33,7 @@ NamedMapsAdminController.prototype.register = function (app) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
app.put(
|
app.put(
|
||||||
`${base_url_templated}/:template_id`,
|
`${templateBasePath}/:template_id`,
|
||||||
cors(),
|
cors(),
|
||||||
userMiddleware(),
|
userMiddleware(),
|
||||||
localsMiddleware(),
|
localsMiddleware(),
|
||||||
@ -45,7 +45,7 @@ NamedMapsAdminController.prototype.register = function (app) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
app.get(
|
app.get(
|
||||||
`${base_url_templated}/:template_id`,
|
`${templateBasePath}/:template_id`,
|
||||||
cors(),
|
cors(),
|
||||||
userMiddleware(),
|
userMiddleware(),
|
||||||
localsMiddleware(),
|
localsMiddleware(),
|
||||||
@ -56,7 +56,7 @@ NamedMapsAdminController.prototype.register = function (app) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
app.delete(
|
app.delete(
|
||||||
`${base_url_templated}/:template_id`,
|
`${templateBasePath}/:template_id`,
|
||||||
cors(),
|
cors(),
|
||||||
userMiddleware(),
|
userMiddleware(),
|
||||||
localsMiddleware(),
|
localsMiddleware(),
|
||||||
@ -67,7 +67,7 @@ NamedMapsAdminController.prototype.register = function (app) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
app.get(
|
app.get(
|
||||||
`${base_url_templated}/`,
|
`${templateBasePath}/`,
|
||||||
cors(),
|
cors(),
|
||||||
userMiddleware(),
|
userMiddleware(),
|
||||||
localsMiddleware(),
|
localsMiddleware(),
|
||||||
@ -78,7 +78,7 @@ NamedMapsAdminController.prototype.register = function (app) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
app.options(
|
app.options(
|
||||||
`${base_url_templated}/:template_id`,
|
`${templateBasePath}/:template_id`,
|
||||||
cors('Content-Type')
|
cors('Content-Type')
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user