#api
5 snippets tagged with #api
HTTP Client with Axios Interceptors
Pre-configured Axios instance with request/response interceptors for auth headers, logging, and retry logic.
Optimistic Update Pattern
Apply UI changes immediately before server confirmation with automatic rollback on failure.
Type-Safe API Route Handler
Next.js App Router route handler with input validation, typed responses, and proper error handling.
Streaming API Response
Stream long-running API responses using ReadableStream and TransformStream for real-time data delivery.
FastAPI Dependency Injection
Use FastAPI's dependency injection for database sessions, auth checks, and shared service logic.