正在显示
4 个修改的文件
包含
1 行增加
和
49 行删除
@@ -78,7 +78,6 @@ IoC.use('igloo', require('./igloo')); | @@ -78,7 +78,6 @@ IoC.use('igloo', require('./igloo')); | ||
78 | var app = bootable(express()); | 78 | var app = bootable(express()); |
79 | 79 | ||
80 | app.phase(bootable.di.initializers()); | 80 | app.phase(bootable.di.initializers()); |
81 | -app.phase(bootable.di.routes('./routes')); | ||
82 | 81 | ||
83 | app.boot(function (err) { | 82 | app.boot(function (err) { |
84 | 83 |
routes/index.js
已删除
100644 → 0
1 | - | ||
2 | -// app - routes | ||
3 | - | ||
4 | -var bootable = require('../bootable'); | ||
5 | -var IoC = require('electrolyte'); | ||
6 | - | ||
7 | -exports = module.exports = function (settings) { | ||
8 | - | ||
9 | - var app = this; | ||
10 | - | ||
11 | - | ||
12 | - | ||
13 | - //auth | ||
14 | - app.phase(bootable.di.routes('./routes/users.js')); | ||
15 | - | ||
16 | -}; | ||
17 | - | ||
18 | -exports['@require'] = ['igloo/settings']; |
routes/users.js
已删除
100644 → 0
1 | -var express = require('express'); | ||
2 | -var IoC = require('electrolyte'); | ||
3 | - | ||
4 | -exports = module.exports = function (settings, logger) { | ||
5 | - var app = this; | ||
6 | - var router = express.Router(); | ||
7 | - router.get('/', function (req, res, next) { | ||
8 | - res.render('index', { 'csrfToken': 'xxxx' }); | ||
9 | - }); | ||
10 | - router.get('/login', function (req, res, next) { | ||
11 | - res.render('index', { 'csrfToken': 'xxxx' }); | ||
12 | - }); | ||
13 | - app.use('/', router); | ||
14 | - app.use(settings.proxy.signOutUrl, function (req, res, next) { | ||
15 | - req.session.token = null; | ||
16 | - req.session.save(function (err) { | ||
17 | - if (err) | ||
18 | - logger.error(err); | ||
19 | - else | ||
20 | - res.redirect(settings.proxy.signInUrl); | ||
21 | - }); | ||
22 | - }); | ||
23 | - | ||
24 | -}; | ||
25 | - | ||
26 | -exports['@singleton'] = true; | ||
27 | -exports['@require'] = ['igloo/settings', 'igloo/logger']; |
@@ -6,9 +6,7 @@ var app = workaiExpress.app; | @@ -6,9 +6,7 @@ var app = workaiExpress.app; | ||
6 | var IoC = workaiExpress.IoC; | 6 | var IoC = workaiExpress.IoC; |
7 | var bootable = workaiExpress.bootable; | 7 | var bootable = workaiExpress.bootable; |
8 | 8 | ||
9 | -IoC.use(IoC.dir(path.join(__dirname, 'boot')));//重载配置 | ||
10 | - | ||
11 | -app.phase(bootable.di.routes('./routes'));//载入路由 | 9 | +IoC.use(IoC.dir(path.join(__dirname, 'boot')));//重载配置 |
12 | 10 | ||
13 | app.boot(function (err) { | 11 | app.boot(function (err) { |
14 | if (err) { | 12 | if (err) { |
请
注册
或
登录
后发表评论