4.3 KiB
APIs, requests, and mocks
Use this topic to add endpoints, debug Axios responses and interceptors, investigate duplicate requests or cancellation on navigation, or change demo data. Start with the request contract.
| Question | Read first | Follow through |
|---|---|---|
| Business endpoints, paginated data, and request configuration | Application APIs, application request instance, request configuration | Person endpoint caller, integration guide |
| Axios interceptors, errors, and client isolation | Shared client, shared types | Application request interceptor, response interceptor |
| Duplicate requests, AbortSignal, and cancellation on navigation | Shared RequestCanceler, application cancellation provider | Layout content slot, TablePro remote requests |
| HTTP mocks shared by development and the online demo | Mock handlers, shared demo data | Unified business API, mock bootstrap |
Application axios/utils contains compatibility re-exports. The default request signal is injected only if the caller has not supplied a signal and has not disabled default cancellation. Demo data does not represent production endpoints or authorization. Frontend VITE_* configuration must not hold secrets.
Targeted verification: pnpm harness verify api first runs api:check for generated OpenAPI files and the MSW worker, then the application request, client isolation, and mock regressions. Verify production backend integration, browser downloads, and real end-to-end flows separately when those behaviors are affected.
For standard backend integration, start with the shared contract package, business schemas, demo schemas, OpenAPI generation, and integration guide. Pages call APIs exclusively, including for search options and route-example lists/details. The mock database owns demo writes and permission checks. In production backend mode, a remote-route load failure aborts startup. Legacy application contract paths remain as compatibility re-exports.