-
Notifications
You must be signed in to change notification settings - Fork 81
Create apiBase module and wire client fetch to /api/* #1621
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Parent PRD
What to build
Create a new module exporting an apiBase constant computed from import.meta.env.BASE_URL. Update all explorer fetch functions (_gremlinFetch, _sparqlFetch, _openCypherFetch) and summary endpoints to use apiBase instead of connection.url. Update the Vite dev server proxy config to a single /api rule.
This is the core client-side change that decouples outbound requests from the connection URL.
Type: HITL — requires review before completion.
Acceptance criteria
- New
apiBasemodule exports a constant derived fromBASE_URL -
apiBaseresolves tohttp://localhost/api/for defaultBASE_URLof/ -
apiBaseresolves correctly for prefixedBASE_URL(e.g.,/proxy/9250/) - All explorer fetch functions use
apiBasefor request URLs - Summary endpoints use
apiBasefor request URLs - Vite dev proxy config simplified to
"/api": { target: expressServerUrl } - Tests verify
apiBasecomputation for default and prefixedBASE_URL - Tests verify explorer fetch functions send requests to correct
apiBase-derived URLs
Blocked by
User stories addressed
- User story 8
- User story 12
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request