Skip to content

fix:#386 replace hardcoded HEROKU URL with configurable API_BASE_URL#410

Open
Cypher-CP0 wants to merge 1 commit intoEAPD-DRB:mainfrom
Cypher-CP0:configurable-api-base-url
Open

fix:#386 replace hardcoded HEROKU URL with configurable API_BASE_URL#410
Cypher-CP0 wants to merge 1 commit intoEAPD-DRB:mainfrom
Cypher-CP0:configurable-api-base-url

Conversation

@Cypher-CP0
Copy link
Copy Markdown

Linked issue

Existing related work reviewed

Overlap assessment

Why this PR should proceed

  • The hardcoded https://osemosys.herokuapp.com/ URL silently breaks all API calls on any non-Heroku deployment. The fix is a single-file, non-breaking change that unblocks cloud and multi-user deployments with zero impact on local dev workflows.

Summary

  • What changed: Removed static HEROKU = 0 flag and the hardcoded https://osemosys.herokuapp.com/ URL from WebAPP/Classes/Base.Class.js. apiUrl() now reads from window.API_BASE_URL if set at deploy time, falling back to window.location.origin for local and standard same-origin deployments.
  • Why: HEROKU = 1 hardcoded the API target to a specific Heroku app, causing all API calls to silently fail on any other deployment environment. Replacing it with window.API_BASE_URL makes the URL configurable without touching source code, following 12-factor app principles.

Validation

  • Tests added/updated (or not applicable)
  • Validation steps documented
  • Evidence attached (logs/screenshots/output as relevant)

Documentation

  • Docs updated in this PR (or not applicable — README notes local-only scope; server deployment docs deferred to follow-up)
  • Any setup/workflow changes reflected in repo docs

Scope check

  • No unrelated refactors
  • Implemented from a feature branch
  • Change is deliverable without upstream OSeMOSYS/MUIO dependency
  • Base repo/branch is EAPD-DRB/MUIOGO:main (not upstream)

Exception rationale

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Hardcoded Deployment URL in Base.Class.js

1 participant