web.js
578 Bytes
/* eslint-disable no-var */
var path = require('path');
var workaiExpress = require('./index');
var app = workaiExpress.app;
var IoC = workaiExpress.IoC;
var bootable = workaiExpress.bootable;
IoC.use(IoC.dir(path.join(__dirname, 'boot')));//重载配置
IoC.create('igloo/server').then(function (server) {
app.phase(bootable.di.initializers());
app.phase(bootable.di.routes('./routes'));
app.phase(server);
app.boot(function (err) {
if (err) {
console.log(err);
process.exit(-1);
return;
}
});
});