expo-api-routes
Expo API Routes
Overview
Expo API Routes let you write server-side endpoints alongside your React Native app code. Routes use the +api.ts file suffix and run on the server, never shipped to the client bundle. This keeps credentials secure and enables direct database access.
Core principle: API routes are server-only code collocated with your app. They deploy to EAS Hosting (Cloudflare Workers) and handle standard HTTP request/response patterns.
When to Use
- Protecting API keys, database credentials, or third-party secrets from the client
- Building webhooks (Stripe, payment processors, push notification services)
- Performing server-side data validation or transformation
- Connecting directly to databases (Neon, Supabase, PlanetScale, Turso)
- Proxying requests to external APIs with rate limiting
- Server-side rendering or data aggregation
File Convention
More from bidah/react-native-hifi
use-dom
Use when embedding web-only libraries or DOM content in React Native apps, including charts with recharts, syntax highlighting, rich text editors, or any component that requires a browser DOM
1software-mansion-best-practices
Software Mansion's best practices for production React Native apps on the New Architecture. Use when writing, reviewing, or debugging React Native code across animations, gestures, SVG, haptics, on-device AI, multimedia, rich text, multithreading, or audio. Trigger on any React Native implementation question or when a more specific sub-skill below matches the task.
1writing-plans
Use when you have a spec or requirements for a multi-step task, before touching code
1agent-device
Automates interactions for iOS simulators/devices and Android emulators/devices. Use when navigating apps, taking snapshots/screenshots, tapping, typing, scrolling, or extracting UI info on mobile targets.
1expo-ui-swift-ui
Use when building iOS-specific UI components using SwiftUI views in Expo, embedding React Native views in SwiftUI with RNHostView, or implementing native iOS interfaces beyond cross-platform components
1brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.
1