Authored by 郭成尧

'3party-dispatch'

  1 +/**
  2 + * sub app coupon
  3 + * @author: lixia.zhang<lixia.zhang@yoho.cn>
  4 + * @date: 2016/05/31
  5 + */
  6 +
  7 +var express = require('express'),
  8 + path = require('path'),
  9 + helpers = require(path.join(global.utils, 'helpers'));
  10 +
  11 +var app = express();
  12 +
  13 +// set view engin
  14 +var doraemon = path.join(__dirname, '../../doraemon/views'); // parent view root
  15 +
  16 +app.on('mount', function(parent) {
  17 + delete parent.locals.settings; // 不继承父 App 的设置
  18 + Object.assign(app.locals, parent.locals);
  19 +});
  20 +app.use(global.yoho.hbs({
  21 + extname: '.hbs',
  22 + defaultLayout: 'layout',
  23 + layoutsDir: doraemon,
  24 + partialsDir: path.join(__dirname, 'views/partial'),
  25 + views: path.join(__dirname, 'views/action'),
  26 + helpers: Object.assign({}, global.yoho.helpers, helpers)
  27 +}));
  28 +
  29 +// router
  30 +app.use(require('./router'));
  31 +
  32 +module.exports = app;
  1 +/**
  2 + * router of sub app coupon
  3 + * @author: lixia.zhang<lixia.zhang@yoho.cn>
  4 + * @date: 2016/05/31
  5 + */
  6 +
  7 +'use strict';
  8 +
  9 +const router = require('express').Router(); // eslint-disable-line
  10 +const cRoot = './controllers';
  11 +const ads = require(`${cRoot}/ads`);
  12 +
  13 +// routers
  14 +
  15 +router.get('/ads', ads.index);
  16 +
  17 +module.exports = router;
@@ -26,7 +26,6 @@ const shopCollect = require(`${cRoot}/shopCollect`); @@ -26,7 +26,6 @@ const shopCollect = require(`${cRoot}/shopCollect`);
26 26
27 const singleDay = require(`${cRoot}/single-day`); 27 const singleDay = require(`${cRoot}/single-day`);
28 const share = require(`${cRoot}/share`); 28 const share = require(`${cRoot}/share`);
29 -const union = require(`${cRoot}/union`);  
30 29
31 // routers 30 // routers
32 31
@@ -106,7 +105,6 @@ router.get('/single-day/getSingleData', singleDay.getSingleData); @@ -106,7 +105,6 @@ router.get('/single-day/getSingleData', singleDay.getSingleData);
106 router.get('/single-day/getProductData', singleDay.getProductData); 105 router.get('/single-day/getProductData', singleDay.getProductData);
107 106
108 router.get('/share', share.getShareContent); 107 router.get('/share', share.getShareContent);
109 -router.get('/union', union.index);  
110 108
111 // 102828会员日 109 // 102828会员日
112 router.get('/vip-day1028', vipDay1028.index); 110 router.get('/vip-day1028', vipDay1028.index);
@@ -21,4 +21,7 @@ module.exports = app => { @@ -21,4 +21,7 @@ module.exports = app => {
21 21
22 // 分期付款 22 // 分期付款
23 app.use('/home', require('./apps/home')); 23 app.use('/home', require('./apps/home'));
  24 +
  25 + // 第三方服务处理
  26 + app.use('/3party', require('./apps/3party'));
24 }; 27 };