api-routes

Implement API routes in Expo Router for server-side operations.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/cgasgarth/opencode-config --skill api-routes-cgasgarth
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-routes
Source: https://github.com/cgasgarth/opencode-config/tree/main/skill/expo-app-design/skills/api-routes
Command: npx skills add https://github.com/cgasgarth/opencode-config --skill api-routes-cgasgarth

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides comprehensive guidelines and examples for creating server-side API routes within an Expo Router application, enabling secure data handling, external API integration, and server-side logic.

Core Features & Use Cases

  • Secure Server-Side Logic: Implement logic that requires server-side secrets (API keys, database credentials) or sensitive operations.
  • Database Operations & Third-Party Proxies: Directly interact with databases or proxy requests to external services while protecting API keys.
  • Use Case: Securely fetch data from a private API or process user data on the server before saving it to a database, ensuring client-side security.

Quick Start

Create a new API route by adding a +api.ts file inside your app directory.

Frequently Asked Questions about api-routes

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

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

Create serverless API routes in Expo Router by adding a `+api.ts` file inside your `app` directory to handle HTTP methods, dynamic routes, and request parameters for server-side operations.

Can I securely manage database credentials and API keys using Expo Router API routes?

Yes, Expo Router API routes securely manage database credentials and API keys by executing server-side logic, allowing direct database operations and third-party proxies while protecting client-side security.

Does Expo Router support deploying serverless APIs to Cloudflare Workers?

Yes, Expo Router supports deploying serverless APIs to Cloudflare Workers through EAS Hosting, enabling serverless backend execution for your API routes.

What are the limitations of building backend APIs with Expo Router?

Building backend APIs with Expo Router carries serverless environment limitations, requiring adherence to best practices for stateless operations and handling constraints specific to Cloudflare Workers deployments.

How do I handle HTTP methods and environment variables in Expo Router API routes?

Handle HTTP methods and environment variables in Expo Router API routes by configuring the `+api.ts` file to process request parameters and access environment variables for secure server-side logic execution.