-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
proxy.conf.js
54 lines (49 loc) · 1.16 KB
/
proxy.conf.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
48
49
50
51
52
53
54
const fs = require("fs");
let PROXY_CONFIG;
let configContent;
const CONFIG_FILE_NAME = "mempool-frontend-config.json";
try {
const rawConfig = fs.readFileSync(CONFIG_FILE_NAME);
configContent = JSON.parse(rawConfig);
console.log(`${CONFIG_FILE_NAME} file found, using provided config`);
} catch (e) {
console.log(e);
if (e.code !== "ENOENT") {
throw new Error(e);
} else {
console.log(`${CONFIG_FILE_NAME} file not found, using default config`);
}
}
PROXY_CONFIG = [
{
context: ["*", "/api/**", "!/api/v1/ws", "/testnet/api/**"],
target: "https://ferritecoin.com",
ws: true,
secure: false,
changeOrigin: true,
},
{
context: ["/api/v1/ws"],
target: "https://ferritecoin.com",
ws: true,
secure: false,
changeOrigin: true,
},
{
context: ["/resources/mining-pools/**"],
target: "https://ferritecoin.com",
secure: false,
changeOrigin: true,
},
{
context: [
"/resources/assets.json",
"/resources/assets.minimal.json",
"/resources/worldmap.json",
],
target: "https://ferritecoin.com",
secure: false,
changeOrigin: true,
},
];
module.exports = PROXY_CONFIG;