Renamed controllers routing method
This commit is contained in:
parent
96e9fcbe33
commit
f7a3c6ac4e
10
app/app.js
10
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;
|
||||
}
|
||||
|
@ -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));
|
||||
};
|
||||
|
||||
|
@ -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));
|
||||
};
|
||||
|
||||
|
@ -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));
|
||||
};
|
||||
|
||||
|
@ -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));
|
||||
};
|
||||
|
@ -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));
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user