GAZ-278: Added local demo file fallback when VITE_API_URL is not set(FIXES GAZ-207).#69
Merged
abhinav-1305 merged 2 commits intoApr 29, 2026
Conversation
Contributor
Author
|
Thank you, @abhinav-1305, for the review. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
problem
The Demo Runtime had no fallback mechanism when
VITE_API_URLwas 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 withoutJFrogcredentials.Solution
Added local file fallback logic in
fetchDemoListData.tsandfetchDemoData.tsso that whenVITE_API_URLis not set, the app reads demo data directly frompublic/examples/.Changes
fetchDemoListData.ts: falls back topublic/examples/metadata.jsonwhen VITE_API_URL is not set.fetchDemoData.ts: falls back topublic/examples/{demoId}.jsonwhen VITE_API_URL is not set.demo-page.tsx: fixed URL path index from[3]to[2]to correctly extractdemoidfrom 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.