Authored by 郭成尧

'3party-dispatch'

/**
* sub app coupon
* @author: lixia.zhang<lixia.zhang@yoho.cn>
* @date: 2016/05/31
*/
var express = require('express'),
path = require('path'),
helpers = require(path.join(global.utils, 'helpers'));
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.use(global.yoho.hbs({
extname: '.hbs',
defaultLayout: 'layout',
layoutsDir: doraemon,
partialsDir: path.join(__dirname, 'views/partial'),
views: path.join(__dirname, 'views/action'),
helpers: Object.assign({}, global.yoho.helpers, helpers)
}));
// router
app.use(require('./router'));
module.exports = app;
... ...
/**
* router of sub app coupon
* @author: lixia.zhang<lixia.zhang@yoho.cn>
* @date: 2016/05/31
*/
'use strict';
const router = require('express').Router(); // eslint-disable-line
const cRoot = './controllers';
const ads = require(`${cRoot}/ads`);
// routers
router.get('/ads', ads.index);
module.exports = router;
... ...
... ... @@ -26,7 +26,6 @@ const shopCollect = require(`${cRoot}/shopCollect`);
const singleDay = require(`${cRoot}/single-day`);
const share = require(`${cRoot}/share`);
const union = require(`${cRoot}/union`);
// routers
... ... @@ -106,7 +105,6 @@ router.get('/single-day/getSingleData', singleDay.getSingleData);
router.get('/single-day/getProductData', singleDay.getProductData);
router.get('/share', share.getShareContent);
router.get('/union', union.index);
// 102828会员日
router.get('/vip-day1028', vipDay1028.index);
... ...
... ... @@ -21,4 +21,7 @@ module.exports = app => {
// 分期付款
app.use('/home', require('./apps/home'));
// 第三方服务处理
app.use('/3party', require('./apps/3party'));
};
... ...