api-routes

Create API routes in Expo Router with EAS Hosting using +api.ts handlers.

1|Updated Jul 25, 2023
One-click install
npx skills add https://github.com/yurkenn/english-tales --skill api-routes-yurkenn
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-routes
Source: https://github.com/yurkenn/english-tales/tree/main/.agent/skills/api-routes
Command: npx skills add https://github.com/yurkenn/english-tales --skill api-routes-yurkenn

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Guidelines to build and document API routes for Expo Router with EAS Hosting, providing safe, scalable patterns.

Core Features & Use Cases

  • File-based API routes: Create endpoints under app/api using +api.ts handlers.
  • Security & deployment: Manage secrets, environment variables, CORS, and robust error handling for production.
  • Patterns & extensibility: Support dynamic routes, multiple HTTP methods, and testing examples for common backends.

Quick Start

Create a basic +api.ts GET handler under app/api to expose a simple endpoint.

Frequently Asked Questions about api-routes

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

FAQPage Schema
How do I create API routes in Expo Router with EAS Hosting?

Create API routes in Expo Router by adding +api.ts handler files under the app/api directory. This file-based approach allows you to define endpoints that deploy directly to EAS Hosting.

How do I manage server-side secrets and environment variables for Expo API routes?

Manage server-side secrets and environment variables using the specified environment handling guidelines for Expo API routes. This ensures sensitive data like database credentials remains secure during production deployment.

Can I set up rate limiting and webhook endpoints using Expo Router?

Yes, you can set up webhook endpoints and implement rate limiting using Expo Router. The guidelines provide patterns for securing these endpoints, including robust error handling and CORS configuration.

What is the best way to test Expo API routes before EAS deployment?

Test Expo API routes by following the testing examples provided in the guidelines. These patterns cover common backend operations, ensuring your endpoints handle database operations and third-party proxies correctly before deployment.

Does Expo Router support dynamic API routes and CORS configuration?

Yes, Expo Router supports dynamic API routes and requires CORS configuration for secure cross-origin requests. The guidelines specify how to structure these dynamic endpoints and manage robust error handling for production environments.