api-routes

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

Updated Jan 14, 2026
One-click install
npx skills add https://github.com/marcoodignoti/couple-diary --skill api-routes-marcoodignoti
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-routes
Source: https://github.com/marcoodignoti/couple-diary/tree/main/.claude/skills/api-routes
Command: npx skills add https://github.com/marcoodignoti/couple-diary --skill api-routes-marcoodignoti

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides guidelines to design and manage API routes in Expo Router with EAS Hosting, enabling secure server-side logic and clean separation from client-side code.

Core Features & Use Cases

  • File Structure: API routes live under app/api with +api.ts per endpoint.
  • HTTP Methods: Export named functions for GET, POST, PUT, and DELETE to handle requests.
  • Environment & Security: Emphasize using environment variables, secret management, and robust error handling.
  • Deployment: Guidance for local testing and deploying API routes to EAS Hosting.

Quick Start

Create your API routes under app/api using the +api.ts convention and export handlers for each HTTP method, then deploy to EAS Hosting.

Frequently Asked Questions about api-routes

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

FAQPage Schema
How do I create server-side API routes in Expo Router?

Expo Router API routes are created by placing a +api.ts file under the app/api directory and exporting named functions for HTTP methods like GET, POST, PUT, and DELETE to handle server-side requests.

What is the best way to handle secure server-side validation in Expo Router?

Secure server-side validation in Expo Router is handled within API routes by using environment variables for secret management and implementing robust error handling directly in your HTTP method exports.

Does Expo Router support API routing for webhooks and proxies?

Yes, Expo Router supports API routing for webhooks and proxies by defining server-side endpoints in +api.ts files, enabling data access and secure server-side logic execution.

How do I deploy Expo Router API routes to EAS Hosting?

To deploy Expo Router API routes to EAS Hosting, define your endpoints in app/api, test them locally, and then follow the EAS Hosting deployment steps to publish your server-side logic.

Can I use environment variables for secret management in Expo Router API routes?

Yes, you can use environment variables for secret management in Expo Router API routes to securely handle sensitive data and keep server-side logic separated from client-side code.

Why do I need separate +api.ts files for Expo Router API endpoints?

Separate +api.ts files are needed to cleanly separate server-side API logic from client-side code, allowing each file to export specific HTTP method handlers and manage CORS and errors independently.