expo-api-routes

Implement server-side API endpoints in Expo Router apps on EAS Hosting.

Updated May 7, 2026
One-click install
npx skills add https://github.com/softwarebyze/Backgammon-Mastermind --skill expo-api-routes-softwarebyze
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: expo-api-routes
Source: https://github.com/softwarebyze/Backgammon-Mastermind/tree/main/.agents/skills/expo-api-routes
Command: npx skills add https://github.com/softwarebyze/Backgammon-Mastermind --skill expo-api-routes-softwarebyze

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you design and deploy secure, reliable API routes for Expo Router apps running on EAS Hosting.

Core Features & Use Cases

  • Server-side secrets and validation: Keep API keys and sensitive operations off the client while validating inputs before writes.
  • Structured API routing: Create REST-style endpoints with HTTP method exports and dynamic segments (e.g., users/[id]).
  • EAS Hosting compatibility: Works within Cloudflare Workers constraints (Web APIs instead of Node.js, edge-friendly database options).
  • Real-world use case: Proxy an external weather/AI provider call so your mobile app never sees the provider key, and return a clean JSON response with proper HTTP statuses.

Quick Start

Ask your team to create the endpoint at app/api/your-route+api.ts and export the HTTP methods you need (for example, GET and POST) so EAS Hosting deploys it as /api/your-route.

Frequently Asked Questions about expo-api-routes

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create secure API routes in Expo Router?

Secure API routes in Expo Router are created by exporting HTTP methods like GET and POST from files named app/api/your-route+api.ts, which EAS Hosting deploys as server-side endpoints. This keeps sensitive operations off the client.

Can I use Node.js modules in EAS Hosting API routes?

EAS Hosting API routes run on Cloudflare Workers, so you cannot use Node.js modules. You must use Web APIs and edge-friendly database options instead of Node.js-specific runtime features.

How do I keep server-side secrets hidden in an Expo app?

To keep server-side secrets hidden in an Expo app, access process.env exclusively within your app/api/*+api.ts endpoints. This proxies external provider calls so your mobile app never sees the API key, returning clean JSON responses.

What's the best way to handle CORS and dynamic parameters in Expo Router endpoints?

Handle CORS and dynamic parameters in Expo Router endpoints by structuring routes like users/[id] and configuring CORS headers within the method exports in your app/api/*+api.ts files.

Why do my Expo API routes require specific file naming conventions?

Expo API routes require specific file naming conventions like +api.ts to ensure deterministic endpoint behavior. EAS Hosting uses these method exports in app/api/*+api.ts to correctly deploy and route your server-side endpoints.