From f7a3c6ac4edf0c954b6559e95ce60372f29698a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Thu, 3 Dec 2015 18:43:13 +0100 Subject: [PATCH] Renamed controllers routing method --- app/app.js | 10 +++++----- app/controllers/cache_status_controller.js | 2 +- app/controllers/generic_controller.js | 2 +- app/controllers/health_check_controller.js | 2 +- app/controllers/query_controller.js | 2 +- app/controllers/version_controller.js | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/app.js b/app/app.js index 3cf6ffd9..c942a212 100644 --- a/app/app.js +++ b/app/app.js @@ -160,19 +160,19 @@ function App() { // basic routing var genericController = new GenericController(); - genericController.register(app); + genericController.route(app); var queryController = new QueryController(metadataBackend, tableCache, statsd_client); - queryController.register(app); + queryController.route(app); var cacheStatusController = new CacheStatusController(tableCache); - cacheStatusController.register(app); + cacheStatusController.route(app); var healthCheckController = new HealthCheckController(); - healthCheckController.register(app); + healthCheckController.route(app); var versionController = new VersionController(); - versionController.register(app); + versionController.route(app); return app; } diff --git a/app/controllers/cache_status_controller.js b/app/controllers/cache_status_controller.js index f9661a8d..2b7a4cf5 100644 --- a/app/controllers/cache_status_controller.js +++ b/app/controllers/cache_status_controller.js @@ -6,7 +6,7 @@ function CacheStatusController(tableCache) { this.tableCache = tableCache; } -CacheStatusController.prototype.register = function (app) { +CacheStatusController.prototype.route = function (app) { app.get(global.settings.base_url + '/cachestatus', this.handleCacheStatus.bind(this)); }; diff --git a/app/controllers/generic_controller.js b/app/controllers/generic_controller.js index 8fd79a65..da1bbe88 100644 --- a/app/controllers/generic_controller.js +++ b/app/controllers/generic_controller.js @@ -5,7 +5,7 @@ var setCrossDomain = require('../utils/cross_domain'); function GenericController() { } -GenericController.prototype.register = function (app) { +GenericController.prototype.route = function (app) { app.options('*', this.handleRequest.bind(this)); }; diff --git a/app/controllers/health_check_controller.js b/app/controllers/health_check_controller.js index 79a74095..29458cf9 100644 --- a/app/controllers/health_check_controller.js +++ b/app/controllers/health_check_controller.js @@ -6,7 +6,7 @@ function HealthCheckController() { this.healthCheck = new HealthCheck(global.settings.disabled_file); } -HealthCheckController.prototype.register = function (app) { +HealthCheckController.prototype.route = function (app) { app.get(global.settings.base_url + '/health', this.handleHealthCheck.bind(this)); }; diff --git a/app/controllers/query_controller.js b/app/controllers/query_controller.js index c10c0827..87cd0270 100644 --- a/app/controllers/query_controller.js +++ b/app/controllers/query_controller.js @@ -26,7 +26,7 @@ function QueryController(metadataBackend, tableCache, statsd_client) { this.statsd_client = statsd_client; } -QueryController.prototype.register = function (app) { +QueryController.prototype.route = function (app) { app.all(global.settings.base_url + '/sql', this.handleQuery.bind(this)); app.all(global.settings.base_url + '/sql.:f', this.handleQuery.bind(this)); }; diff --git a/app/controllers/version_controller.js b/app/controllers/version_controller.js index 90407eb3..853ff891 100644 --- a/app/controllers/version_controller.js +++ b/app/controllers/version_controller.js @@ -7,7 +7,7 @@ var version = { function VersionController() { } -VersionController.prototype.register = function (app) { +VersionController.prototype.route = function (app) { app.get(global.settings.base_url + '/version', this.handleVersion.bind(this)); };