-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsetupProxy.js
42 lines (41 loc) · 919 Bytes
/
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
39
40
41
42
const { createProxyMiddleware } = require("http-proxy-middleware");
module.exports = function (app) {
app.use(
["/api/**", "/static-files/**"],
createProxyMiddleware({
target: "http://localhost:8000",
changeOrigin: true,
})
);
app.use(
["/config.js"],
createProxyMiddleware({
target: "http://localhost:8000",
changeOrigin: true,
secure: false,
pathRewrite: {
"^/config.js": "/api/v1/config.js",
},
})
);
app.use(
["/app"],
createProxyMiddleware({
target: "http://localhost:3000",
changeOrigin: true,
pathRewrite: {
"^/app": "/apk/rtmis.apk",
},
})
);
app.use(
["/master-data"],
createProxyMiddleware({
target: "http://localhost:3000",
changeOrigin: true,
pathRewrite: {
"^/master-data": "/master_data/kenya-administration.csv",
},
})
);
};