expo-api-routes

Implement secure server-side API routes in Expo Router with EAS Hosting.

Updated Feb 16, 2026
One-click install
npx skills add https://github.com/json-choi/yogiya --skill expo-api-routes-json-choi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: expo-api-routes
Source: https://github.com/json-choi/yogiya/tree/main/apps/mobile/.agents/skills/expo-api-routes
Command: npx skills add https://github.com/json-choi/yogiya --skill expo-api-routes-json-choi

SYSTEM DOCUMENTATION & REQUIREMENTS

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.

Frequently Asked Questions about expo-api-routes

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

FAQPage Schema
How do I secure API keys and handle webhooks in Expo Router?

Secure API keys and handle webhooks in Expo Router by implementing server-side API routes that keep secrets and backend logic isolated from client bundles. Define HTTP method handlers to safely process webhook callbacks and proxy external services.

Can I use Node.js APIs in Expo API routes deployed to EAS Hosting?

Expo API routes deployed to EAS Hosting run on Cloudflare Workers and cannot use Node.js APIs. Use standard fetch for network requests and cloud databases, and account for execution timeouts when handling server-side logic.

How do I define REST endpoints and HTTP methods in Expo Router?

Define REST endpoints and HTTP methods in Expo Router by exporting named GET, POST, PUT, DELETE, and OPTIONS handlers inside the app directory. Apply server-side validation, enforce CORS, and query cloud databases using environment variables.

What's the best way to handle CORS and authentication in Expo server-side routes?

Handle CORS and authentication in Expo server-side routes by configuring OPTIONS handlers for preflight requests and validating tokens within your request handlers. This ensures database operations and proxy requests remain secure.

Does Expo Router support server-side database operations for mobile apps?

Expo Router supports server-side database operations for mobile apps by running backend logic in API routes using environment variables. This allows you to query recommended cloud databases directly without exposing credentials to the client.