From 6bf06116df33e09adf9dc640afe48a58f36ffe16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Wed, 28 Mar 2018 20:12:11 +0200 Subject: [PATCH] Build controllers (analysis and server info) in server --- lib/cartodb/controllers/index.js | 4 ---- .../controllers/{server_info.js => server-info.js} | 0 lib/cartodb/server.js | 14 ++++++++++---- 3 files changed, 10 insertions(+), 8 deletions(-) delete mode 100644 lib/cartodb/controllers/index.js rename lib/cartodb/controllers/{server_info.js => server-info.js} (100%) diff --git a/lib/cartodb/controllers/index.js b/lib/cartodb/controllers/index.js deleted file mode 100644 index b3623cb5..00000000 --- a/lib/cartodb/controllers/index.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - Analyses: require('./analyses'), - ServerInfo: require('./server_info') -}; diff --git a/lib/cartodb/controllers/server_info.js b/lib/cartodb/controllers/server-info.js similarity index 100% rename from lib/cartodb/controllers/server_info.js rename to lib/cartodb/controllers/server-info.js diff --git a/lib/cartodb/server.js b/lib/cartodb/server.js index 4ef54339..d5410369 100644 --- a/lib/cartodb/server.js +++ b/lib/cartodb/server.js @@ -6,8 +6,6 @@ var RedisPool = require('redis-mpool'); var cartodbRedis = require('cartodb-redis'); var _ = require('underscore'); -var controller = require('./controllers'); - const AnalysisLayergroupController = require('./controllers/layergroup/analysis'); const AttributesLayergroupController = require('./controllers/layergroup/attributes'); const DataviewLayergroupController = require('./controllers/layergroup/dataview'); @@ -21,6 +19,10 @@ const AdminTemplateController = require('./controllers/template/admin'); const PreviewTemplateController = require('./controllers/template/preview'); 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 NamedMapsCacheEntry = require('./cache/model/named_maps_entry'); var VarnishHttpCacheBackend = require('./cache/backend/varnish_http'); @@ -352,9 +354,13 @@ module.exports = function(serverOptions) { userLimitsApi ).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;