mirror of
https://github.com/zhigang1992/deployd.git
synced 2026-05-24 13:59:27 +08:00
27 lines
530 B
JavaScript
27 lines
530 B
JavaScript
// dependencies for initial app load
|
|
// use spawn inheritance
|
|
require('./spawn');
|
|
|
|
var config = require('./config').load()
|
|
, fs = require('fs')
|
|
, app = require('./app')
|
|
, plugins = fs.readdirSync(__dirname + '/plugins')
|
|
, path
|
|
;
|
|
|
|
lib = {
|
|
require: function(module) {
|
|
return require('./' + module);
|
|
}
|
|
};
|
|
|
|
// load plugins
|
|
plugins.forEach(function(fd) {
|
|
path = __dirname + '/plugins/' + fd;
|
|
if(fs.statSync(path).isDirectory()) {
|
|
require(path);
|
|
}
|
|
});
|
|
|
|
// start up the app
|
|
app.listen(config.port, config.host); |