Fix explorer routing, links, and frontend API loading
This commit is contained in:
@@ -13,6 +13,21 @@ The frontend is reachable at **https://explorer.d-bis.org** (FQDN) or by **VM IP
|
||||
2. **Same-origin /api** – When the site is served from the explorer host (FQDN `https://explorer.d-bis.org` or VM IP `http://192.168.11.140` / `https://192.168.11.140`), the frontend uses relative `/api` so all requests go through the same nginx proxy. If you open the frontend from elsewhere, the code falls back to the full Blockscout URL (CORS must allow it).
|
||||
- If the API returns **200** but the UI still shows no data, check the browser console for JavaScript errors (e.g. CSP or network errors).
|
||||
|
||||
### Frontend env contract
|
||||
|
||||
For the Next frontend in `frontend/`, keep the runtime base URL at the **host origin**, not the `/api` subpath:
|
||||
|
||||
```env
|
||||
NEXT_PUBLIC_API_URL=https://explorer.d-bis.org
|
||||
NEXT_PUBLIC_CHAIN_ID=138
|
||||
```
|
||||
|
||||
Why:
|
||||
|
||||
- The Next pages now call live **Blockscout v2** endpoints under `${NEXT_PUBLIC_API_URL}/api/v2/*`.
|
||||
- Setting `NEXT_PUBLIC_API_URL=https://explorer.d-bis.org/api` will incorrectly produce requests like `/api/api/v2/*`.
|
||||
- Token aggregation remains under `/token-aggregation/api/v1/*` and is linked separately by the frontend.
|
||||
|
||||
---
|
||||
|
||||
## CSP blocks eval / “script-src blocked”
|
||||
|
||||
Reference in New Issue
Block a user