quick tidy

This commit is contained in:
Simon Tokumine 2011-10-07 17:28:07 +01:00
parent f50522d72c
commit eba7eb4e28
3 changed files with 35 additions and 32 deletions

6
app.js
View File

@ -12,7 +12,7 @@
var _ = require('underscore'); var _ = require('underscore');
// sanity check arguments // sanity check arguments
var ENV = process.argv[2] var ENV = process.argv[2];
if (ENV != 'development' && ENV != 'production') { if (ENV != 'development' && ENV != 'production') {
console.error("\n./app [environment]"); console.error("\n./app [environment]");
console.error("environments: [development, test, production]"); console.error("environments: [development, test, production]");
@ -20,8 +20,8 @@ if (ENV != 'development' && ENV != 'production') {
} }
// set Node.js app settings and boot // set Node.js app settings and boot
global.settings = require(__dirname + '/config/settings') global.settings = require(__dirname + '/config/settings');
var env = require(__dirname + '/config/environments/' + ENV) var env = require(__dirname + '/config/environments/' + ENV);
_.extend(global.settings, env); _.extend(global.settings, env);
// kick off controller // kick off controller

View File

@ -13,7 +13,7 @@ var _ = require('underscore');
var cluster = require('cluster'); var cluster = require('cluster');
// sanity check arguments // sanity check arguments
var ENV = process.argv[2] var ENV = process.argv[2];
if (ENV != 'development' && ENV != 'production' && ENV != 'test' && ENV != 'staging') { if (ENV != 'development' && ENV != 'production' && ENV != 'test' && ENV != 'staging') {
console.error("\n./cluster [environment]"); console.error("\n./cluster [environment]");
console.error("environments: [development, test, production, staging]"); console.error("environments: [development, test, production, staging]");
@ -21,13 +21,11 @@ if (ENV != 'development' && ENV != 'production' && ENV != 'test' && ENV != 'stag
} }
// set Node.js app settings and boot // set Node.js app settings and boot
global.settings = require(__dirname + '/config/settings') global.settings = require(__dirname + '/config/settings');
var env = require(__dirname + '/config/environments/' + ENV) var env = require(__dirname + '/config/environments/' + ENV);
_.extend(global.settings, env); _.extend(global.settings, env);
cluster('./app/controllers/app') cluster('./app/controllers/app')
// .set('workers', 2)
// .set('socket path', '/tmp')
.use(cluster.logger('logs')) .use(cluster.logger('logs'))
.use(cluster.stats()) .use(cluster.stats())
.use(cluster.pidfiles('pids')) .use(cluster.pidfiles('pids'))

View File

@ -1,26 +1,31 @@
{ {
"private": true, "private": true,
"name": "cartodb_api", "name": "cartodb_api",
"description": "high speed SQL api for cartodb", "description": "high speed SQL api for cartodb",
"version": "0.0.1", "version": "0.0.1",
"dependencies": { "author": {
"cluster": "0.6.4", "name": "Simon Tokumine, Vizzuality",
"express": "2.4.3", "url": "http://vizzuality.com",
"underscore" : "1.1.x", "email": "simon@vizzuality.com"
"underscore.string": "1.1.5", },
"pg": "0.5.6", "dependencies": {
"generic-pool": "1.0.x", "cluster": "0.6.4",
"redis": "0.6.1", "express": "2.4.3",
"step": "0.0.x", "underscore" : "1.1.x",
"oauth-client": "0.2.0", "underscore.string": "1.1.5",
"libxmljs": "0.4.2" "pg": "0.5.6",
}, "generic-pool": "1.0.x",
"devDependencies": { "redis": "0.6.1",
"expresso": "0.8.x" "step": "0.0.x",
}, "oauth-client": "0.2.0",
"scripts": { "libxmljs": "0.4.2"
"unit": "expresso ./test/unit/* | sh", },
"acceptance": "expresso ./test/acceptance/* | sh" "devDependencies": {
}, "expresso": "0.8.x"
"engines": { "node": ">= 0.4.1 < 0.5.0" } },
"scripts": {
"unit": "expresso ./test/unit/* | sh",
"acceptance": "expresso ./test/acceptance/* | sh"
},
"engines": { "node": ">= 0.4.1 < 0.5.0" }
} }