-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
proxy.conf.mixed.js
47 lines (40 loc) · 977 Bytes
/
proxy.conf.mixed.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
43
44
45
46
47
const fs = require("fs");
const FRONTEND_CONFIG_FILE_NAME = "mempool-frontend-config.json";
let configContent;
// Read frontend config
try {
const rawConfig = fs.readFileSync(FRONTEND_CONFIG_FILE_NAME);
configContent = JSON.parse(rawConfig);
console.log(`${FRONTEND_CONFIG_FILE_NAME} file found, using provided config`);
} catch (e) {
console.log(e);
if (e.code !== "ENOENT") {
throw new Error(e);
} else {
console.log(
`${FRONTEND_CONFIG_FILE_NAME} file not found, using default config`
);
}
}
let PROXY_CONFIG = [];
PROXY_CONFIG.push(
...[
{
context: ["/api/v1/**"],
target: `http://localhost:8999`,
secure: false,
ws: true,
changeOrigin: true,
proxyTimeout: 30000,
},
{
context: ["/api/**"],
target: `https://ferritecoin.com`,
secure: false,
changeOrigin: true,
proxyTimeout: 30000,
},
]
);
console.log(PROXY_CONFIG);
module.exports = PROXY_CONFIG;