-
Notifications
You must be signed in to change notification settings - Fork 248
/
app.js
30 lines (26 loc) · 963 Bytes
/
app.js
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
const koa = require('koa');
const serve = require('koa-static');
const session = require('koa-session');
const bodyParams = require('koa-bodyparser');
const config = require('./com/config')
const login = require('./api/login'); // 登录 退出
const pay = require('./api/addons/pay'); // 支付
const updata = require('./api/addons/updata'); // 上传图片
const qrcode = require('./api/qrcode'); // 获取二维码信息
const googs = require('./api/goods'); // 商品管理
const order = require('./api/order'); // 订单信息
const count = require('./api/count'); // 各种统计数据展示
const app = new koa();
app.proxy = true;
app.keys = ['some secret hurr'];
app.use(session(config.sessionConfig,app))
app.use(bodyParams())
app.use(login.routes())
app.use(pay.routes())
app.use(updata.routes())
app.use(googs.routes())
app.use(qrcode.routes())
app.use(order.routes())
app.use(count.routes())
app.use(serve(__dirname + '/www'));
app.listen(80);