Loading...
Loading...
Defines an HTTP API endpoint under src/routes/api, with the method as the macro argument (GET/POST/PUT/PATCH/DELETE). Returns JSON or any axum response.
A GET endpoint returning JSON:
A POST endpoint reading a typed JSON body, with state injected by name:
Call it from the frontend with the typed client (see createApiClient):