hjemmesidekongen/ai/expo-api-routes

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

API routes in Expo Router — server functions, request handling, middleware, and type-safe endpoints

Install

npx vskill@latest install hjemmesidekongen/ai/expo-api-routes

SKILL.md

Expo API Routes

Expo Router supports API routes via +api.ts files — server-only handlers running in Node.js, not in the React Native runtime. They enable full-stack Expo without a separate backend.

File Convention

app/
api/
users+api.ts # /api/users
users/[id]+api.ts # /api/users/:id

Request Handlers

Export named functions per HTTP method using ExpoRequest / ExpoResponse from expo-router/server:

ts
import { ExpoRequest, ExpoResponse } from 'expo-router/server';
export async function GET(request: ExpoRequest): Promise<ExpoResponse> {
const users = await db.user.findMany();
return ExpoResponse.json(users);
}
export async function POST(request: ExpoRequest): Promise<ExpoResponse> {
const body = await request.json();
const user = await db.user.create({ data: body });
return ExpoResponse.json(user, { status: 201 });
}

Key Rules

  • API routes run server-side — never import React or RN components.
  • Validate inputs with zod before touching any database or external service.
  • Authenticate via Authorization: Bearer headers — cookies aren't reliable in RN clients.
  • Server-only env vars are never bundled into the native app — safe to use in API routes.
  • Return explicit status codes on every error path — default is 200, which misleads clients.

See references/process.md for dynamic segments, middleware, auth, database access, type sharing, error handling, deployment, and anti-patterns.

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
5

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/hjemmesidekongen/ai/expo-api-routes/badge)](https://verified-skill.com/skills/hjemmesidekongen/ai/expo-api-routes)

Something wrong with this skill or its page? Tell us.