-
Notifications
You must be signed in to change notification settings - Fork 0
/
setupProxy.js
38 lines (34 loc) · 1.07 KB
/
setupProxy.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
35
36
37
38
var proxy = require ("http-proxy-middleware");
module.exports = function (app) {
app.use (
proxy("/api", {
target: "http://127.0.0.1:3010/api",
changeOrigin: true,
secure: false
})
);
app.use (
proxy("/admin", {
target: "http://127.0.0.1:3010/admin",
changeOrigin: true,
secure: false
})
);
app.use (
proxy("/upload", {
target: "http://127.0.0.1:3010/",
changeOrigin: true,
secure: false
})
);
app.use (
proxy("/baidu", {
target: "https://www.baidu.com/",
changeOrigin: true,
secure: false,
pathRewrite: {
"^/baidu": ""
}
})
);
};