api.ts
Central API client. All HTTP calls go through this.
Connections
- consumed by: every page and component that calls the backend
- backend: unlikely-api (port 8000)
Notes
- Base URL: /api
- Methods: get, post, put, patch, del, upload
- Auth: credentials: ‘include’ (cookie-based JWT)
- Error handling: throws ApiError (status, detail) on non-2xx
- Auto-redirect to login on 401