mirror of
https://github.com/zhigang1992/deployd.git
synced 2026-05-25 16:11:26 +08:00
20 lines
504 B
JavaScript
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); |