Skip to content

GAZ-278: Added local demo file fallback when VITE_API_URL is not set(FIXES GAZ-207).#69

Merged
abhinav-1305 merged 2 commits into
openMF:devfrom
kanishksingh23:add/local-demo-file-support
Apr 29, 2026
Merged

GAZ-278: Added local demo file fallback when VITE_API_URL is not set(FIXES GAZ-207).#69
abhinav-1305 merged 2 commits into
openMF:devfrom
kanishksingh23:add/local-demo-file-support

Conversation

@kanishksingh23
Copy link
Copy Markdown
Contributor

problem
The Demo Runtime had no fallback mechanism when VITE_API_URL was not set. This caused the demo list and individual demo pages to fail silently with no data, making it impossible to run or test demos locally without JFrog credentials.

Solution
Added local file fallback logic in fetchDemoListData.ts and fetchDemoData.ts so that when VITE_API_URL is not set, the app reads demo data directly from public/examples/.

Changes
fetchDemoListData.ts: falls back to public/examples/metadata.json when VITE_API_URL is not set.
fetchDemoData.ts: falls back to public/examples/{demoId}.json when VITE_API_URL is not set.
demo-page.tsx: fixed URL path index from [3] to [2] to correctly extract demoid from the pathname, without which no demo would load.
public/examples/metadata.json: added metadata index file for local demos.
public/examples/4f187905-c47e-4ebd-a095-ba254e8bfd80.json: added Batch Payments demo JSON for local testing.

Testing
Tested locally without VITE_API_URL set. Demo list loaded correctly from local metadata. The Batch Payments demo page loaded and rendered successfully.
Screenshot 2026-04-23 at 12 17 30 PM
Screenshot 2026-04-23 at 12 17 14 PM

@kanishksingh23 kanishksingh23 changed the title GAZ-278: Added local demo file fallback when VITE_API_URL is not set. GAZ-278: Added local demo file fallback when VITE_API_URL is not set(FIXES GAZ-207). Apr 23, 2026
Copy link
Copy Markdown
Member

@abhinav-1305 abhinav-1305 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@abhinav-1305 abhinav-1305 merged commit 57e8acb into openMF:dev Apr 29, 2026
4 checks passed
@kanishksingh23
Copy link
Copy Markdown
Contributor Author

Thank you, @abhinav-1305, for the review.

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.

2 participants