Extract initProfiler middleware from map-controller
This commit is contained in:
@@ -72,7 +72,7 @@ MapController.prototype.composeCreateMapMiddleware = function (useTemplate = fal
|
||||
userMiddleware(),
|
||||
allowQueryParams(['aggregation']),
|
||||
this.prepareContext,
|
||||
this.initProfiler(isTemplateInstantiation),
|
||||
initProfiler(isTemplateInstantiation),
|
||||
this.checkJsonContentType(),
|
||||
useTemplate ? this.checkInstantiteLayergroup() : this.checkCreateLayergroup(),
|
||||
useTemplate ? this.getTemplate() : this.prepareAdapterMapConfig(),
|
||||
@@ -97,7 +97,7 @@ MapController.prototype.composeCreateMapMiddleware = function (useTemplate = fal
|
||||
];
|
||||
};
|
||||
|
||||
MapController.prototype.initProfiler = function (isTemplateInstantiation) {
|
||||
function initProfiler (isTemplateInstantiation) {
|
||||
const operation = isTemplateInstantiation ? 'instance_template' : 'createmap';
|
||||
|
||||
return function initProfilerMiddleware (req, res, next) {
|
||||
@@ -105,7 +105,7 @@ MapController.prototype.initProfiler = function (isTemplateInstantiation) {
|
||||
req.profiler.done(`${operation}.initProfilerMiddleware`);
|
||||
next();
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
MapController.prototype.checkJsonContentType = function () {
|
||||
return function checkJsonContentTypeMiddleware(req, res, next) {
|
||||
|
||||
Reference in New Issue
Block a user