Renamed controllers routing method

This commit is contained in:
Daniel García Aubert 2015-12-03 18:43:13 +01:00
parent 96e9fcbe33
commit f7a3c6ac4e
6 changed files with 10 additions and 10 deletions

View File

@ -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;
}

View File

@ -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));
};

View File

@ -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));
};

View File

@ -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));
};

View File

@ -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));
};

View File

@ -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));
};