Build controllers (analysis and server info) in server

This commit is contained in:
Daniel García Aubert 2018-03-28 20:12:11 +02:00
parent 5bb5bc42ee
commit 6bf06116df
3 changed files with 10 additions and 8 deletions

View File

@ -1,4 +0,0 @@
module.exports = {
Analyses: require('./analyses'),
ServerInfo: require('./server_info')
};

View File

@ -6,8 +6,6 @@ var RedisPool = require('redis-mpool');
var cartodbRedis = require('cartodb-redis'); var cartodbRedis = require('cartodb-redis');
var _ = require('underscore'); var _ = require('underscore');
var controller = require('./controllers');
const AnalysisLayergroupController = require('./controllers/layergroup/analysis'); const AnalysisLayergroupController = require('./controllers/layergroup/analysis');
const AttributesLayergroupController = require('./controllers/layergroup/attributes'); const AttributesLayergroupController = require('./controllers/layergroup/attributes');
const DataviewLayergroupController = require('./controllers/layergroup/dataview'); const DataviewLayergroupController = require('./controllers/layergroup/dataview');
@ -21,6 +19,10 @@ const AdminTemplateController = require('./controllers/template/admin');
const PreviewTemplateController = require('./controllers/template/preview'); const PreviewTemplateController = require('./controllers/template/preview');
const TileTemplateController = require('./controllers/template/tile'); const TileTemplateController = require('./controllers/template/tile');
const AnalysesController = require('./controllers/analyses');
const ServerInfoController = require('./controllers/server-info');
var SurrogateKeysCache = require('./cache/surrogate_keys_cache'); var SurrogateKeysCache = require('./cache/surrogate_keys_cache');
var NamedMapsCacheEntry = require('./cache/model/named_maps_entry'); var NamedMapsCacheEntry = require('./cache/model/named_maps_entry');
var VarnishHttpCacheBackend = require('./cache/backend/varnish_http'); var VarnishHttpCacheBackend = require('./cache/backend/varnish_http');
@ -352,9 +354,13 @@ module.exports = function(serverOptions) {
userLimitsApi userLimitsApi
).register(templateRouter); ).register(templateRouter);
new controller.Analyses(pgConnection, authApi, userLimitsApi).register(mapRouter); new AnalysesController(
pgConnection,
authApi,
userLimitsApi
).register(mapRouter);
new controller.ServerInfo(versions).register(monitorRouter); new ServerInfoController(versions).register(monitorRouter);
const { base_url_mapconfig: mapConfigBasePath, base_url_templated: templateBasePath } = serverOptions; const { base_url_mapconfig: mapConfigBasePath, base_url_templated: templateBasePath } = serverOptions;