What problem does it solve?
Provide a clear, secure pattern for implementing server-side API routes within Expo Router so that secrets, database operations, and third-party API keys never reach the client and server-specific logic can run reliably for mobile apps.
Core Features & Use Cases
- Server-side secrets — Keep API keys, tokens, and database credentials on the server and out of client bundles.
- HTTP method handlers — Define GET, POST, PUT, DELETE, and OPTIONS handlers to implement REST endpoints inside the app directory.
- Proxying & Webhooks — Safely proxy external APIs and receive webhook callbacks without exposing secrets.
- Deployment guidance — Notes and constraints for EAS Hosting (Cloudflare Workers) including missing Node APIs, fetch usage, timeouts, and recommended cloud databases.
- Use Case: Build an authenticated /api/users endpoint that validates input, queries a cloud database using environment variables, and returns JSON while enforcing CORS and rate limits.
Quick Start
Start the Expo dev server with API route support using npx expo serve and verify your endpoint at /api/hello by fetching it from your app.