What problem does it solve?
This Skill unit addresses the challenge of creating and managing API routes in Expo applications hosted on EAS, providing a structured approach to handle server-side secrets, database operations, and third-party API proxies.
Core Features & Use Cases
- Server-side Secrets: Securely manage API keys, database credentials, and tokens.
- Database Operations: Execute direct database queries without exposing them to the client.
- Third-party API Proxies: Hide API keys when calling external services.
- Server-side Validation: Validate data before database writes.
- Webhook Endpoints: Receive callbacks from services like Stripe or GitHub.
- Rate Limiting: Control access at the server level.
- Heavy Computation: Offload processing that would be slow on mobile.
- File Uploads: Use direct-to-storage uploads for efficient handling.
- Authentication Middleware: Implement authentication checks.
- Proxy External API: Route requests to external APIs securely.
- CORS Headers: Add CORS for web clients.
- Error Handling: Gracefully manage API errors.
- Testing Locally: Start the development server with API routes.
- Deployment to EAS Hosting: Build and deploy API routes to EAS Hosting.
- Environment Variables: Use environment variables for secrets.
- Custom Domain: Configure a custom domain for API routes.
- EAS Hosting Runtime: Utilize Cloudflare Workers for API route execution.
- Database Options: Integrate with cloud databases like Cloudflare D1, Turso, PlanetScale, Supabase, and Neon.
- Calling API Routes from Client: Access API routes from client-side code.
- Common Patterns: Follow best practices for authentication and proxying.
Quick Start
Create a new API route in your Expo project by following the guidelines outlined in the SKILL.md file.