正在显示
1 个修改的文件
包含
32 行增加
和
0 行删除
1 | +var path = require('path'); | ||
2 | +var IoC = require('electrolyte'); | ||
3 | +var bootable = require('./bootable'); | ||
4 | +var express = require('express'); | ||
5 | + | ||
6 | +process.chdir(__dirname); | ||
7 | +//依赖注入 | ||
8 | +IoC.use(IoC.dir(path.join(__dirname, 'boot'))); | ||
9 | +IoC.use('igloo', require('./igloo')); | ||
10 | + | ||
11 | + | ||
12 | +var app = bootable(express()); | ||
13 | + | ||
14 | +app.phase(bootable.di.initializers()); | ||
15 | +app.phase(bootable.di.routes('./routes')); | ||
16 | + | ||
17 | +IoC.create('igloo/server').then(function (server) { | ||
18 | + app.phase(server); | ||
19 | + // app.boot(function (err) { | ||
20 | + | ||
21 | + // if (err) { | ||
22 | + // console.log(err); | ||
23 | + // process.exit(-1); | ||
24 | + // return; | ||
25 | + // } | ||
26 | + | ||
27 | + // }); | ||
28 | +}); | ||
29 | + | ||
30 | + | ||
31 | + | ||
32 | +module.exports = app; |
请
注册
或
登录
后发表评论