-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathserver.js
More file actions
24 lines (23 loc) · 720 Bytes
/
server.js
File metadata and controls
24 lines (23 loc) · 720 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const express = require('express');
const proxy = require('http-proxy-middleware');
const app = express();
app.use('/static', express.static('static'));
app.use('/assets', express.static('assets'));
app.use('/api', proxy({
target: 'http://api.zhuishushenqi.com/',
pathRewrite: { '^/api': '/' },
changeOrigin: true,
}));
app.use('/chapter', proxy({
target: 'http://chapter2.zhuishushenqi.com/',
pathRewrite: { '^/chapter': '/chapter' },
changeOrigin: true,
}));
app.use('/agent', proxy({
target: 'http://statics.zhuishushenqi.com/',
// pathRewrite: { '^/chapter': '/chapter' },
changeOrigin: true,
}));
app.use('/', express.static(`${__dirname}/dist`));
app.listen(8080);
console.log('服务器8080');