mirror of
https://github.com/mempool/mempool.git
synced 2025-02-23 14:40:38 +01:00
Proxy all /api and /api/v1 requests to local nodejs server
This commit is contained in:
parent
5c1fc7344d
commit
02e15cbea4
1 changed files with 8 additions and 9 deletions
|
@ -49,7 +49,14 @@ PROXY_CONFIG.map(conf => conf.target = "http://localhost:8999");
|
||||||
// Add rules for local backend
|
// Add rules for local backend
|
||||||
if (backendConfigContent) {
|
if (backendConfigContent) {
|
||||||
PROXY_CONFIG.push({
|
PROXY_CONFIG.push({
|
||||||
context: ['/api/address/**', '/api/tx/**', '/api/block/**', '/api/blocks/**'],
|
context: ['/api/v1/**'],
|
||||||
|
target: `http://localhost:8999`,
|
||||||
|
secure: false,
|
||||||
|
changeOrigin: true,
|
||||||
|
proxyTimeout: 30000
|
||||||
|
});
|
||||||
|
PROXY_CONFIG.push({
|
||||||
|
context: ['/api/**'],
|
||||||
target: `http://localhost:8999`,
|
target: `http://localhost:8999`,
|
||||||
secure: false,
|
secure: false,
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
|
@ -57,15 +64,7 @@ if (backendConfigContent) {
|
||||||
pathRewrite: {
|
pathRewrite: {
|
||||||
"^/api/": "/api/v1/"
|
"^/api/": "/api/v1/"
|
||||||
},
|
},
|
||||||
});
|
|
||||||
PROXY_CONFIG.push({
|
|
||||||
context: ['/api/v1/**'],
|
|
||||||
target: `http://localhost:8999`,
|
|
||||||
secure: false,
|
|
||||||
changeOrigin: true,
|
|
||||||
proxyTimeout: 30000
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(PROXY_CONFIG);
|
console.log(PROXY_CONFIG);
|
||||||
|
|
Loading…
Add table
Reference in a new issue