Skip to content

Commit 0898975

Browse files
JOYclaude
andcommitted
fix: correct stats/visualize API URL construction for frontend
Frontend uses `new URL(path, host)` — when path starts with `/`, JS URL constructor ignores any path in the host. So putting `/stats-api` in STATS_API_HOST was silently broken (browser hit wrong endpoint → N/A). - Mainnet: use subdomain (stats.doscan.io, viz.doscan.io) - Testnet/Beta: split HOST and BASE_PATH correctly Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 70d6d0a commit 0898975

3 files changed

Lines changed: 10 additions & 8 deletions

File tree

docker-compose/envs/common-frontend-beta.env

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,14 @@ NEXT_PUBLIC_HAS_USER_OPS=true
197197
# =============================================================================
198198
# FEATURE: STATS SERVICE
199199
# =============================================================================
200-
NEXT_PUBLIC_STATS_API_HOST=https://beta-stats.doscan.io
200+
NEXT_PUBLIC_STATS_API_HOST=https://beta.doscan.io
201+
NEXT_PUBLIC_STATS_API_BASE_PATH=/stats-api
201202

202203
# =============================================================================
203204
# FEATURE: VISUALIZE API
204205
# =============================================================================
205-
NEXT_PUBLIC_VISUALIZE_API_HOST=https://beta-viz.doscan.io
206+
NEXT_PUBLIC_VISUALIZE_API_HOST=https://beta.doscan.io
207+
NEXT_PUBLIC_VISUALIZE_API_BASE_PATH=/visualize
206208

207209
# =============================================================================
208210
# FEATURE: METADATA SERVICE

docker-compose/envs/common-frontend-testnet.env

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,14 +258,14 @@ NEXT_PUBLIC_MARKETPLACE_CATEGORIES_URL=https://raw.githubusercontent.com/DOSLabs
258258
# =============================================================================
259259
# FEATURE: SOLIDITY TO UML
260260
# =============================================================================
261-
NEXT_PUBLIC_VISUALIZE_API_HOST=https://test.doscan.io/visualize
262-
# NEXT_PUBLIC_VISUALIZE_API_BASE_PATH=
261+
NEXT_PUBLIC_VISUALIZE_API_HOST=https://test.doscan.io
262+
NEXT_PUBLIC_VISUALIZE_API_BASE_PATH=/visualize
263263

264264
# =============================================================================
265265
# FEATURE: BLOCKCHAIN STATISTICS
266266
# =============================================================================
267-
NEXT_PUBLIC_STATS_API_HOST=https://test.doscan.io/stats-api
268-
# NEXT_PUBLIC_STATS_API_BASE_PATH=
267+
NEXT_PUBLIC_STATS_API_HOST=https://test.doscan.io
268+
NEXT_PUBLIC_STATS_API_BASE_PATH=/stats-api
269269

270270
# =============================================================================
271271
# FEATURE: WEB3 WALLET INTEGRATION

docker-compose/envs/common-frontend.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,12 @@ NEXT_PUBLIC_HAS_USER_OPS=true
197197
# =============================================================================
198198
# FEATURE: STATS SERVICE
199199
# =============================================================================
200-
NEXT_PUBLIC_STATS_API_HOST=https://doscan.io/stats-api
200+
NEXT_PUBLIC_STATS_API_HOST=https://stats.doscan.io
201201

202202
# =============================================================================
203203
# FEATURE: VISUALIZE API
204204
# =============================================================================
205-
NEXT_PUBLIC_VISUALIZE_API_HOST=https://doscan.io/visualize
205+
NEXT_PUBLIC_VISUALIZE_API_HOST=https://viz.doscan.io
206206

207207
# =============================================================================
208208
# FEATURE: METADATA SERVICE

0 commit comments

Comments
 (0)