app module moved to right place

This commit is contained in:
Daniel García Aubert 2015-12-03 18:33:17 +01:00
parent d31d496a2e
commit c6bae6d951
22 changed files with 27 additions and 27 deletions

2
app.js
View File

@ -78,7 +78,7 @@ if ( ! global.settings.base_url ) {
var version = require("./package").version; var version = require("./package").version;
var app = require(global.settings.app_root + '/app/controllers/app')(); var app = require(global.settings.app_root + '/app/app')();
app.listen(global.settings.node_port, global.settings.node_host, function() { app.listen(global.settings.node_port, global.settings.node_host, function() {
console.log( console.log(
"CartoDB SQL API %s listening on %s:%s with base_url %s (%s)", "CartoDB SQL API %s listening on %s:%s with base_url %s (%s)",

View File

@ -24,7 +24,7 @@ var LRU = require('lru-cache');
process.env.PGAPPNAME = process.env.PGAPPNAME || 'cartodb_sqlapi'; process.env.PGAPPNAME = process.env.PGAPPNAME || 'cartodb_sqlapi';
// override Date.toJSON // override Date.toJSON
require('../utils/date_to_json'); require('./utils/date_to_json');
// jshint maxcomplexity:21 // jshint maxcomplexity:21
function App() { function App() {
@ -153,23 +153,23 @@ function App() {
// basic routing // basic routing
var GenericController = require('./generic_controller'); var GenericController = require('./controllers/generic_controller');
var genericController = new GenericController(); var genericController = new GenericController();
genericController.register(app); genericController.register(app);
var QueryController = require('./query_controller'); var QueryController = require('./controllers/query_controller');
var queryController = new QueryController(metadataBackend, tableCache, statsd_client); var queryController = new QueryController(metadataBackend, tableCache, statsd_client);
queryController.register(app); queryController.register(app);
var CacheStatusController = require('./cache_status_controller'); var CacheStatusController = require('./controllers/cache_status_controller');
var cacheStatusController = new CacheStatusController(tableCache); var cacheStatusController = new CacheStatusController(tableCache);
cacheStatusController.register(app); cacheStatusController.register(app);
var HealthCheckController = require('./health_check_controller'); var HealthCheckController = require('./controllers/health_check_controller');
var healthCheckController = new HealthCheckController(); var healthCheckController = new HealthCheckController();
healthCheckController.register(app); healthCheckController.register(app);
var VersionController = require('./version_controller'); var VersionController = require('./controllers/version_controller');
var versionController = new VersionController(); var versionController = new VersionController();
versionController.register(app); versionController.register(app);

View File

@ -1,6 +1,6 @@
require('../helper'); require('../helper');
var app = require(global.settings.app_root + '/app/controllers/app')(); var app = require(global.settings.app_root + '/app/app')();
var assert = require('../support/assert'); var assert = require('../support/assert');
describe('app.auth', function() { describe('app.auth', function() {

View File

@ -14,7 +14,7 @@
*/ */
require('../helper'); require('../helper');
var app = require(global.settings.app_root + '/app/controllers/app')(); var app = require(global.settings.app_root + '/app/app')();
var assert = require('../support/assert'); var assert = require('../support/assert');
var querystring = require('querystring'); var querystring = require('querystring');
var _ = require('underscore'); var _ = require('underscore');

View File

@ -27,7 +27,7 @@ it('does not hang server', function(done){
var db_port_backup = global.settings.db_port; var db_port_backup = global.settings.db_port;
global.settings.db_host = 'localhost'; global.settings.db_host = 'localhost';
global.settings.db_port = sql_server_port; global.settings.db_port = sql_server_port;
var app = require(global.settings.app_root + '/app/controllers/app')(); var app = require(global.settings.app_root + '/app/app')();
step( step(
function sendQuery() { function sendQuery() {
var next = this; var next = this;

View File

@ -2,7 +2,7 @@ require('../../helper');
require('../../support/assert'); require('../../support/assert');
var app = require(global.settings.app_root + '/app/controllers/app')(); var app = require(global.settings.app_root + '/app/app')();
var assert = require('assert'); var assert = require('assert');
var querystring = require('querystring'); var querystring = require('querystring');

View File

@ -2,7 +2,7 @@ require('../../helper');
require('../../support/assert'); require('../../support/assert');
var app = require(global.settings.app_root + '/app/controllers/app')(); var app = require(global.settings.app_root + '/app/app')();
var assert = require('assert'); var assert = require('assert');
var querystring = require('querystring'); var querystring = require('querystring');

View File

@ -1,6 +1,6 @@
require('../../helper'); require('../../helper');
var app = require(global.settings.app_root + '/app/controllers/app')(); var app = require(global.settings.app_root + '/app/app')();
var assert = require('../../support/assert'); var assert = require('../../support/assert');
var querystring = require('querystring'); var querystring = require('querystring');

View File

@ -1,6 +1,6 @@
require('../../helper'); require('../../helper');
var app = require(global.settings.app_root + '/app/controllers/app')(); var app = require(global.settings.app_root + '/app/app')();
var assert = require('../../support/assert'); var assert = require('../../support/assert');
var querystring = require('querystring'); var querystring = require('querystring');
var libxmljs = require('libxmljs'); var libxmljs = require('libxmljs');

View File

@ -1,6 +1,6 @@
require('../../helper'); require('../../helper');
var app = require(global.settings.app_root + '/app/controllers/app')(); var app = require(global.settings.app_root + '/app/app')();
var assert = require('../../support/assert'); var assert = require('../../support/assert');
var querystring = require('querystring'); var querystring = require('querystring');
var shapefile = require('shapefile'); var shapefile = require('shapefile');

View File

@ -1,6 +1,6 @@
require('../../helper'); require('../../helper');
var app = require(global.settings.app_root + '/app/controllers/app')(); var app = require(global.settings.app_root + '/app/app')();
var assert = require('../../support/assert'); var assert = require('../../support/assert');
var sqlite = require('sqlite3'); var sqlite = require('sqlite3');

View File

@ -1,6 +1,6 @@
require('../../helper'); require('../../helper');
var app = require(global.settings.app_root + '/app/controllers/app')(); var app = require(global.settings.app_root + '/app/app')();
var assert = require('../../support/assert'); var assert = require('../../support/assert');
var querystring = require('querystring'); var querystring = require('querystring');

View File

@ -1,6 +1,6 @@
require('../../helper'); require('../../helper');
var app = require(global.settings.app_root + '/app/controllers/app')(); var app = require(global.settings.app_root + '/app/app')();
var assert = require('../../support/assert'); var assert = require('../../support/assert');
var querystring = require('querystring'); var querystring = require('querystring');
var _ = require('underscore'); var _ = require('underscore');

View File

@ -30,7 +30,7 @@ it('aborts request', function(done){
var db_port_backup = global.settings.db_port; var db_port_backup = global.settings.db_port;
global.settings.db_host = 'localhost'; global.settings.db_host = 'localhost';
global.settings.db_port = sql_server_port; global.settings.db_port = sql_server_port;
var app = require(global.settings.app_root + '/app/controllers/app')(); var app = require(global.settings.app_root + '/app/app')();
var timeout; var timeout;
step( step(
function sendQuery() { function sendQuery() {

View File

@ -2,7 +2,7 @@ require('../helper');
require('../support/assert'); require('../support/assert');
var assert = require('assert'); var assert = require('assert');
var app = require(global.settings.app_root + '/app/controllers/app')(); var app = require(global.settings.app_root + '/app/app')();
describe('health checks', function() { describe('health checks', function() {

View File

@ -1,6 +1,6 @@
require('../helper'); require('../helper');
var app = require(global.settings.app_root + '/app/controllers/app')(); var app = require(global.settings.app_root + '/app/app')();
var assert = require('../support/assert'); var assert = require('../support/assert');
var qs = require('querystring'); var qs = require('querystring');

View File

@ -1,6 +1,6 @@
require('../helper'); require('../helper');
var app = require(global.settings.app_root + '/app/controllers/app'); var app = require(global.settings.app_root + '/app/app');
var assert = require('../support/assert'); var assert = require('../support/assert');
var qs = require('querystring'); var qs = require('querystring');
var log4js = require('log4js'); var log4js = require('log4js');

View File

@ -1,6 +1,6 @@
require('../helper'); require('../helper');
var app = require(global.settings.app_root + '/app/controllers/app')(); var app = require(global.settings.app_root + '/app/app')();
var assert = require('../support/assert'); var assert = require('../support/assert');
var qs = require('querystring'); var qs = require('querystring');

View File

@ -1,6 +1,6 @@
require('../helper'); require('../helper');
var app = require(global.settings.app_root + '/app/controllers/app')(); var app = require(global.settings.app_root + '/app/app')();
var assert = require('../support/assert'); var assert = require('../support/assert');
var querystring = require('querystring'); var querystring = require('querystring');

View File

@ -26,7 +26,7 @@ it('after configured milliseconds', function(done){
//console.log("settings:"); console.dir(global.settings); //console.log("settings:"); console.dir(global.settings);
var timeoutBackup = global.settings.node_socket_timeout; var timeoutBackup = global.settings.node_socket_timeout;
global.settings.node_socket_timeout = testTimeout; global.settings.node_socket_timeout = testTimeout;
var app = require(global.settings.app_root + '/app/controllers/app')(); var app = require(global.settings.app_root + '/app/app')();
step( step(
function sendLongQuery() { function sendLongQuery() {
var next = this; var next = this;

View File

@ -10,7 +10,7 @@ describe('transaction', function() {
var server; var server;
before(function(done) { before(function(done) {
server = require(global.settings.app_root + '/app/controllers/app')(); server = require(global.settings.app_root + '/app/app')();
server.listen(SERVER_PORT, '127.0.0.1', done); server.listen(SERVER_PORT, '127.0.0.1', done);
}); });

View File

@ -1,6 +1,6 @@
require('../helper'); require('../helper');
var app = require(global.settings.app_root + '/app/controllers/app')(); var app = require(global.settings.app_root + '/app/app')();
var assert = require('../support/assert'); var assert = require('../support/assert');
var querystring = require('querystring'); var querystring = require('querystring');
var _ = require('underscore'); var _ = require('underscore');