router.js
1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/**
* 路由处理
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2016/3/28
*/
const express = require('express');
const app = new express.Router();
const routes = './routes';
// middleware
// const auth = require('./middleware/auth'); // 登录判断
// Module Controller
var index = require(`${routes}/index`);
var conpon = require(`${routes}/coupon`);
var conponSummer = require(`${routes}/coupon/summer`);
var wxLottery = require(`${routes}/wx-lottery/index`);
// var message = require(`${routes}/message`);
// var starClassroom = require(`${routes}/star-classroom`);
app.get('/', index.index); // 主页
app.get('/user/checkLogin', index.index); // 检查登录 JSONP接口
app.post('/coupon/getSingleCoupon', conpon.getCoupon); // 领券 JSON接口,TODO:可跨域
app.get('/coupon/summer/1', conponSummer.first); // 夏日领券第一波
// app.post('/message/sendSingleMessage', message.sendSingleMessage); // 领券 JSON接口,只测试,不对外公布
app.get('/wx/lottery', wxLottery.index); // 微信抽奖活动
// app.get('/star/classroom', starClassroom.index); // 星潮教室主页
// app.get('/star/classroom/check-in', starClassroom.checkIn); // 星潮教室签到
// app.get('/star/classroom/subject', starClassroom.subject); // 星潮教室星专题
// app.get('/star/classroom/collocation', starClassroom.collocation); // 星潮教室星搭配
module.exports = app;