Proxy /api/v2/ on dev and prod environments

This commit is contained in:
natsoni 2024-08-23 15:42:25 +02:00
parent 37030356dd
commit 2664f52a23
No known key found for this signature in database
GPG Key ID: C65917583181743B
4 changed files with 93 additions and 0 deletions

View File

@ -33,6 +33,17 @@ if (configContent && configContent.BASE_MODULE === 'liquid') {
"^/liquid": ""
},
},
{
context: ['/liquid/api/v2/**'],
target: `http://127.0.0.1:8999`,
secure: false,
ws: true,
changeOrigin: true,
proxyTimeout: 30000,
pathRewrite: {
"^/liquid": ""
},
},
{
context: ['/liquid/api/**'],
target: `http://127.0.0.1:3000`,
@ -54,6 +65,17 @@ if (configContent && configContent.BASE_MODULE === 'liquid') {
"^/liquidtestnet": ""
},
},
{
context: ['/liquidtestnet/api/v2/**'],
target: `http://127.0.0.1:8999`,
secure: false,
ws: true,
changeOrigin: true,
proxyTimeout: 30000,
pathRewrite: {
"^/liquidtestnet": ""
},
},
{
context: ['/liquidtestnet/api/**'],
target: `http://127.0.0.1:3000`,
@ -106,6 +128,14 @@ PROXY_CONFIG.push(...[
changeOrigin: true,
proxyTimeout: 30000,
},
{
context: ['/api/v2/**'],
target: `http://127.0.0.1:8999`,
secure: false,
ws: true,
changeOrigin: true,
proxyTimeout: 30000,
},
{
context: ['/api/**'],
target: `http://127.0.0.1:3000`,

View File

@ -33,6 +33,17 @@ if (configContent && configContent.BASE_MODULE === 'liquid') {
"^/liquid": ""
},
},
{
context: ['/liquid/api/v2/**'],
target: `http://localhost:8999`,
secure: false,
ws: true,
changeOrigin: true,
proxyTimeout: 30000,
pathRewrite: {
"^/liquid": ""
},
},
{
context: ['/liquid/api/**'],
target: `http://localhost:8999`,
@ -54,6 +65,17 @@ if (configContent && configContent.BASE_MODULE === 'liquid') {
"^/liquidtestnet": ""
},
},
{
context: ['/liquidtestnet/api/v2/**'],
target: `http://localhost:8999`,
secure: false,
ws: true,
changeOrigin: true,
proxyTimeout: 30000,
pathRewrite: {
"^/liquidtestnet": ""
},
},
{
context: ['/liquidtestnet/api/**'],
target: `http://localhost:8999`,
@ -94,6 +116,14 @@ PROXY_CONFIG.push(...[
changeOrigin: true,
proxyTimeout: 30000,
},
{
context: ['/api/v2/**'],
target: `http://localhost:8999`,
secure: false,
ws: true,
changeOrigin: true,
proxyTimeout: 30000,
},
{
context: ['/api/**'],
target: `http://localhost:8999`,

View File

@ -33,6 +33,17 @@ if (configContent && configContent.BASE_MODULE === 'liquid') {
"^/liquid": ""
},
},
{
context: ['/liquid/api/v2/**'],
target: `http://localhost:8999`,
secure: false,
ws: true,
changeOrigin: true,
proxyTimeout: 30000,
pathRewrite: {
"^/liquid": ""
},
},
{
context: ['/liquid/api/**'],
target: `https://liquid.network`,
@ -51,6 +62,17 @@ if (configContent && configContent.BASE_MODULE === 'liquid') {
"^/liquidtestnet": ""
},
},
{
context: ['/liquidtestnet/api/v2/**'],
target: `http://localhost:8999`,
secure: false,
ws: true,
changeOrigin: true,
proxyTimeout: 30000,
pathRewrite: {
"^/liquidtestnet": ""
},
},
{
context: ['/liquidtestnet/api/**'],
target: `https://liquid.network`,
@ -78,6 +100,14 @@ PROXY_CONFIG.push(...[
changeOrigin: true,
proxyTimeout: 30000,
},
{
context: ['/api/v2/**'],
target: `http://localhost:8999`,
secure: false,
ws: true,
changeOrigin: true,
proxyTimeout: 30000,
},
{
context: ['/api/**'],
target: `https://mempool.space`,

View File

@ -64,6 +64,9 @@
location /api/ {
proxy_pass http://127.0.0.1:8999/api/v1/;
}
location /api/v2 {
proxy_pass http://127.0.0.1:8999/api/v2;
}
# mainnet API
location /ws {