Files
deployd/lib/boot.js
Ritchie 5b35c44f7a first
2011-09-11 15:30:06 -07:00

20 lines
504 B
JavaScript

// dependencies for initial app load
// why is the file name for the config file hidden in boot.js?
var config = require('./config').load()
, app = require('./app')
, EventEmitter = require('events').EventEmitter
, loader = new EventEmitter();
function load(type) {
config[type].forEach(function(item) {
require('./' + type + '/' + item);
});
}
// load all controllers and models in the config
load('controller');
load('model');
// start up the app
app.listen(config.port, config.host);