Skip to content

Bug: Hardcoded ephemeral Cloudflare tunnel URL in api.js breaks frontend for all local users #8

Description

@anushagarg6

Description

frontend/js/api.js has API_BASE hardcoded to a live Cloudflare tunnel URL:

const API_BASE = "https://provisions-tire-tap-parking.trycloudflare.com/api";

Cloudflare free tunnels are ephemeral — this URL will expire and stop working. Any user who opens the frontend without running scripts/inject-tunnel.py first will silently hit a dead API with no error shown.

Impact

The frontend is completely broken for local development and for any deployment that does not run the inject script first. The previous dynamic origin resolution was removed in this migration.

Location

frontend/js/api.js line 3.

Fix Applied (commit 2936cb5)

Restored the resolveApiBase() function that reads window.CLIMATEINSIGHT_CONFIG.apiBase first (set by the inject script) and falls back to window.location.origin, so local dev, tunnels, and production all work without editing this file.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions