Authored by yyq

删除测试频道

/**
* channel controller
* @author: yyq<yanqing.yang@yoho.cn>
* @date: 2016/06/29
*/
'use strict';
// const _ = require('lodash');
const headerModel = require('../../../doraemon/models/header');
let index = (req, res, next) => {
headerModel.requestHeaderData('boys').then(result => {
res.render('channel', result);
}).catch(next);
};
module.exports = {
index
};
/**
* sub app channel
* @author: yyq<yanqing.yang@yoho.cn>
* @date: 2016/06/29
*/
var express = require('express'),
path = require('path'),
hbs = require('express-handlebars');
var app = express();
// set view engin
var doraemon = path.join(__dirname, '../../doraemon/views'); // parent view root
app.on('mount', function(parent) {
delete parent.locals.settings; // 不继承父 App 的设置
Object.assign(app.locals, parent.locals);
});
app.set('views', path.join(__dirname, 'views/action'));
app.engine('.hbs', hbs({
extname: '.hbs',
defaultLayout: 'layout',
layoutsDir: doraemon,
partialsDir: [path.join(__dirname, 'views/partial'), `${doraemon}/partial`],
helpers: 'helpers'
}));
// router
app.use(require('./router'));
module.exports = app;
/**
* router of sub app channel
* @author: yyq<yanqing.yang@yoho.cn>
* @date: 2016/06/29
*/
'use strict';
const router = require('express').Router(); // eslint-disable-line
const cRoot = './controllers';
// Your controller here
const channelController = require(`${cRoot}/index`);
// 频道页路由
router.get('/', channelController.index);
module.exports = router;
... ... @@ -10,5 +10,4 @@ module.exports = app => {
app.use('/partial', require('./apps/partial')); // 组件demo
// 业务模块
app.use(require('./apps/channel')); // 频道页
};
... ...