Authored by ccbikai

修改子app

1 /** 1 /**
2 - * 频道页面 2 + * 主页
3 * @author: Bi Kai<kai.bi@yoho.cn> 3 * @author: Bi Kai<kai.bi@yoho.cn>
4 * @date: 2016/05/09 4 * @date: 2016/05/09
5 */ 5 */
1 /** 1 /**
2 - * sub app channel 2 + * sub app
3 * @author: Bi Kai<kai.bi@yoho.cn> 3 * @author: Bi Kai<kai.bi@yoho.cn>
4 * @date: 2016/05/09 4 * @date: 2016/05/09
5 */ 5 */
6 6
7 -var express = require('express'),  
8 - path = require('path'),  
9 - hbs = require('express-handlebars'); 7 +const express = require('express');
  8 +const path = require('path');
  9 +const hbs = require('express-handlebars');
10 10
11 -var app = express(); 11 +const app = express();
12 12
13 // set view engin 13 // set view engin
14 -var doraemon = path.join(__dirname, '../../doraemon/views'); // parent view root 14 +const doraemon = path.join(__dirname, '../../doraemon/views'); // parent view root
15 15
16 app.on('mount', function(parent) { 16 app.on('mount', function(parent) {
17 delete parent.locals.settings; // 不继承父 App 的设置 17 delete parent.locals.settings; // 不继承父 App 的设置
@@ -6,6 +6,6 @@ @@ -6,6 +6,6 @@
6 6
7 module.exports = app => { 7 module.exports = app => {
8 8
9 - // 公共服务  
10 - app.use(require('./apps/channel')); 9 + // 组件
  10 + app.use('/component', require('./apps/component'));
11 }; 11 };