正在显示
4 个修改的文件
包含
1 行增加
和
49 行删除
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 | 6 | var IoC = workaiExpress.IoC; |
7 | 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 | 11 | app.boot(function (err) { |
14 | 12 | if (err) { | ... | ... |
请
注册
或
登录
后发表评论