diff --git a/deploy/nginx/omnl-common-locations.conf b/deploy/nginx/omnl-common-locations.conf index 584afbe..419242b 100644 --- a/deploy/nginx/omnl-common-locations.conf +++ b/deploy/nginx/omnl-common-locations.conf @@ -11,7 +11,7 @@ location /api/v1/ { } location /settlement/ { - proxy_pass http://omnl_settlement/api/v1/settlement/; + proxy_pass http://omnl_settlement/; proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; @@ -22,7 +22,7 @@ location /settlement/ { } location /exchange/ { - proxy_pass http://omnl_exchange/api/v1/exchange/; + proxy_pass http://omnl_exchange/; proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; @@ -43,4 +43,12 @@ location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; + add_header Cache-Control "no-cache, no-store, must-revalidate" always; +} + +location = /index.html { + proxy_pass http://omnl_frontend/index.html; + proxy_http_version 1.1; + proxy_set_header Host $host; + add_header Cache-Control "no-cache, no-store, must-revalidate" always; } diff --git a/frontend-dapp/index.html b/frontend-dapp/index.html index 5e2beb6..ba1a61c 100644 --- a/frontend-dapp/index.html +++ b/frontend-dapp/index.html @@ -4,10 +4,38 @@ - Bridge DApp - Chain 138 + OMNL Mission Control — Chain 138 + -
+
+
+
OMNL Mission Control
+
Loading dashboard…
+
+
diff --git a/frontend-dapp/public/serve.json b/frontend-dapp/public/serve.json new file mode 100644 index 0000000..030cca3 --- /dev/null +++ b/frontend-dapp/public/serve.json @@ -0,0 +1,22 @@ +{ + "headers": [ + { + "source": "/index.html", + "headers": [ + { "key": "Cache-Control", "value": "no-cache, no-store, must-revalidate" } + ] + }, + { + "source": "/", + "headers": [ + { "key": "Cache-Control", "value": "no-cache, no-store, must-revalidate" } + ] + }, + { + "source": "/assets/**", + "headers": [ + { "key": "Cache-Control", "value": "public, max-age=31536000, immutable" } + ] + } + ] +} diff --git a/frontend-dapp/src/App.tsx b/frontend-dapp/src/App.tsx index 3068c1e..3feb53d 100644 --- a/frontend-dapp/src/App.tsx +++ b/frontend-dapp/src/App.tsx @@ -37,38 +37,42 @@ const THIRDWEB_CLIENT_ID = import.meta.env.VITE_THIRDWEB_CLIENT_ID || '542981292 function App() { return ( - - - - - - - - }> - } /> - } /> - } /> - } /> - - }> - } /> - } /> - } /> - } /> - } /> - } /> - - - - - - - + + + + + + + }> + } /> + } /> + } /> + } /> + + + + + } + > + } /> + } /> + } /> + } /> + } /> + } /> + + + + + + ) } diff --git a/frontend-dapp/src/config/dex.ts b/frontend-dapp/src/config/dex.ts index f44337a..5aeb255 100644 --- a/frontend-dapp/src/config/dex.ts +++ b/frontend-dapp/src/config/dex.ts @@ -1,11 +1,27 @@ /** DBIS Exchange — Chain 138 DEX addresses (Pancake/Uniswap V2 compatible) */ export const DBIS_EXCHANGE_CHAIN_ID = 138; -export const TOKEN_AGGREGATION_URL = - import.meta.env.VITE_TOKEN_AGGREGATION_URL || 'http://localhost:3000'; -export const DBIS_EXCHANGE_URL = - import.meta.env.VITE_DBIS_EXCHANGE_URL || 'http://localhost:3012'; -export const SETTLEMENT_MIDDLEWARE_URL = - import.meta.env.VITE_SETTLEMENT_MIDDLEWARE_URL || 'http://localhost:3011'; + +function prodOrLocal(envValue: string | undefined, prodPath: string, localUrl: string): string { + const trimmed = envValue?.trim(); + if (trimmed) return trimmed; + return import.meta.env.PROD ? prodPath : localUrl; +} + +export const TOKEN_AGGREGATION_URL = prodOrLocal( + import.meta.env.VITE_TOKEN_AGGREGATION_URL, + '/api/v1', + 'http://localhost:3000', +); +export const DBIS_EXCHANGE_URL = prodOrLocal( + import.meta.env.VITE_DBIS_EXCHANGE_URL, + '/exchange', + 'http://localhost:3012', +); +export const SETTLEMENT_MIDDLEWARE_URL = prodOrLocal( + import.meta.env.VITE_SETTLEMENT_MIDDLEWARE_URL, + '/settlement', + 'http://localhost:3011', +); export const ENHANCED_SWAP_ROUTER_V2 = import.meta.env.VITE_ENHANCED_SWAP_ROUTER_V2 || '0xa421706768aeb7fafa2d912c5e10824ef3437ad4'; diff --git a/scripts/deployment/deploy-omnl-bank-production.sh b/scripts/deployment/deploy-omnl-bank-production.sh index 8566acc..043e83a 100644 --- a/scripts/deployment/deploy-omnl-bank-production.sh +++ b/scripts/deployment/deploy-omnl-bank-production.sh @@ -57,6 +57,9 @@ done log "Building frontend..." cd "$REPO_DIR/frontend-dapp" +export VITE_TOKEN_AGGREGATION_URL="${VITE_TOKEN_AGGREGATION_URL:-/api/v1}" +export VITE_SETTLEMENT_MIDDLEWARE_URL="${VITE_SETTLEMENT_MIDDLEWARE_URL:-/settlement}" +export VITE_DBIS_EXCHANGE_URL="${VITE_DBIS_EXCHANGE_URL:-/exchange}" if command -v pnpm >/dev/null 2>&1; then pnpm install --frozen-lockfile 2>/dev/null || pnpm install pnpm run build