diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index 832efcbbf..9173f8827 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -26,7 +26,7 @@ jobs: with: working-directory: frontend build: npm run config:defaults:mempool - start: npm run start:local-prod + start: npm run start:local-staging wait-on: 'http://localhost:4200' wait-on-timeout: 120 record: true @@ -49,7 +49,7 @@ jobs: with: working-directory: frontend build: npm run config:defaults:liquid - start: npm run start:local-prod + start: npm run start:local-staging wait-on: 'http://localhost:4200' wait-on-timeout: 120 record: true @@ -71,7 +71,7 @@ jobs: with: working-directory: frontend build: npm run config:defaults:bisq - start: npm run start:local-prod + start: npm run start:local-staging wait-on: 'http://localhost:4200' wait-on-timeout: 120 record: true diff --git a/frontend/angular.json b/frontend/angular.json index c2ecbea23..1d2fe3e6b 100644 --- a/frontend/angular.json +++ b/frontend/angular.json @@ -233,6 +233,12 @@ "disableHostCheck": true, "host": "0.0.0.0", "verbose": false + }, + "local-staging": { + "proxyConfig": "proxy.conf.staging.js", + "disableHostCheck": true, + "host": "0.0.0.0", + "verbose": false } } }, diff --git a/frontend/package.json b/frontend/package.json index 4ef9fb48b..b1723da19 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -27,9 +27,11 @@ "serve": "npm run generate-config && ng serve -c local", "serve:stg": "npm run generate-config && ng serve -c staging", "serve:local-prod": "npm run generate-config && ng serve -c local-prod", + "serve:local-staging": "npm run generate-config && ng serve -c local-staging", "start": "npm run generate-config && npm run sync-assets-dev && ng serve -c local", "start:stg": "npm run generate-config && npm run sync-assets-dev && ng serve -c staging", "start:local-prod": "npm run generate-config && npm run sync-assets-dev && ng serve -c local-prod", + "start:local-staging": "npm run generate-config && npm run sync-assets-dev && ng serve -c local-staging", "start:mixed": "npm run generate-config && npm run sync-assets-dev && ng serve -c mixed", "build": "npm run generate-config && ng build --configuration production --localize && npm run sync-assets && npm run build-mempool.js", "sync-assets": "node sync-assets.js && rsync -av ./dist/mempool/browser/en-US/resources ./dist/mempool/browser/resources", @@ -54,7 +56,10 @@ "cypress:run": "cypress run", "cypress:run:record": "cypress run --record", "cypress:open:ci": "node update-config.js TESTNET_ENABLED=true SIGNET_ENABLED=true LIQUID_ENABLED=true BISQ_ENABLED=true ITEMS_PER_PAGE=25 && npm run generate-config && start-server-and-test serve:local-prod 4200 cypress:open", - "cypress:run:ci": "node update-config.js TESTNET_ENABLED=true SIGNET_ENABLED=true LIQUID_ENABLED=true BISQ_ENABLED=true ITEMS_PER_PAGE=25 && npm run generate-config && start-server-and-test serve:local-prod 4200 cypress:run:record" + "cypress:run:ci": "node update-config.js TESTNET_ENABLED=true SIGNET_ENABLED=true LIQUID_ENABLED=true BISQ_ENABLED=true ITEMS_PER_PAGE=25 && npm run generate-config && start-server-and-test serve:local-prod 4200 cypress:run:record", + "cypress:open:ci:staging": "node update-config.js TESTNET_ENABLED=true SIGNET_ENABLED=true LIQUID_ENABLED=true BISQ_ENABLED=true ITEMS_PER_PAGE=25 && npm run generate-config && start-server-and-test serve:local-staging 4200 cypress:open", + "cypress:run:ci:staging": "node update-config.js TESTNET_ENABLED=true SIGNET_ENABLED=true LIQUID_ENABLED=true BISQ_ENABLED=true ITEMS_PER_PAGE=25 && npm run generate-config && start-server-and-test serve:local-staging 4200 cypress:run:record" + }, "dependencies": { "@angular-devkit/build-angular": "^13.1.2", diff --git a/frontend/proxy.conf.js b/frontend/proxy.conf.js index 4a0489c77..77a77bb5a 100644 --- a/frontend/proxy.conf.js +++ b/frontend/proxy.conf.js @@ -20,8 +20,8 @@ try { PROXY_CONFIG = [ { - context: ['*', - '/api/**', '!/api/v1/ws', + context: ['*', + '/api/**', '!/api/v1/ws', '!/bisq', '!/bisq/**', '!/bisq/', '!/liquid', '!/liquid/**', '!/liquid/', '!/liquidtestnet', '!/liquidtestnet/**', '!/liquidtestnet/', @@ -65,7 +65,13 @@ PROXY_CONFIG = [ ws: true, secure: false, changeOrigin: true - } + }, + { + context: ['/resources/mining-pools/**'], + target: "https://mempool.space", + secure: false, + changeOrigin: true + } ]; if (configContent && configContent.BASE_MODULE == "liquid") { diff --git a/frontend/proxy.conf.staging.js b/frontend/proxy.conf.staging.js new file mode 100644 index 000000000..098edb619 --- /dev/null +++ b/frontend/proxy.conf.staging.js @@ -0,0 +1,11 @@ +const fs = require('fs'); + +let PROXY_CONFIG = require('./proxy.conf'); + +PROXY_CONFIG.forEach(entry => { + entry.target = entry.target.replace("mempool.space", "mempool.ninja"); + entry.target = entry.target.replace("liquid.network", "liquid.place"); + entry.target = entry.target.replace("bisq.markets", "bisq.ninja"); +}); + +module.exports = PROXY_CONFIG;