open-navigator / web_app /src /lib /apiClient.ts
jcbowyer's picture
Clean HuggingFace deployment without binary files
e59d91d
Raw
History Blame Contribute Delete
638 Bytes
import createClient from 'openapi-fetch'
import type { paths } from './api.types'
/**
* Typed API client generated from the FastAPI OpenAPI contract.
*
* Path/params/response shapes come from `api.types.ts` (run `npm run gen:api`
* to refresh; CI gates drift). Prefer this over the hand-typed default export
* in `./api` for new call sites and incremental migrations.
*
* The generated path keys are absolute (`/api/...`), so `baseUrl` is empty to
* keep requests origin-relative — matching the production `/api` convention in
* `./api` and the Vite dev proxy.
*/
export const apiTyped = createClient<paths>({ baseUrl: '' })