-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.js
34 lines (31 loc) · 905 Bytes
/
server.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
29
30
31
32
33
34
const express = require('express');
const http = require('superagent');
const fs = require('fs');
const cheerio = require('cheerio');
const hero = require('./test.json');
const bodyParser = require('body-parser')
const xmlParser = require('express-xml-bodyparser');
const routes = require('./router/index');
const wechat = require('./router/wechat')
const work = require('./router/work')
const test = require('./router/test')
let app = express();
//设置post收内容
app.use(xmlParser());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());
//设置静态目录
app.use(express.static('public'));
app.use('/api', routes);
app.use('/wechat',wechat);
app.use('/register-payplatform/rest/register',work);
app.get('/',(req,res) => {
res.redirect('/home');
})
app.use('/test',test)
app.listen('80', function (err) {
if (err) {
return
}
console.log("listen 80")
})