roninforge/roninforge-expo/expo-new-api-route

Claude Code and agent skill by roninforge/roninforge-expo

Trust tier 3
  • community
Source check pending

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

Scaffolds an Expo Router 55 server API route under app/api/<name>+api.ts. Produces a TypeScript file that exports named HTTP method handlers (GET, POST, PUT, DELETE) returning a Response object (via Response.json or new Response with content-type headers). Confirms that app.config.ts has web.output set to "server" so the API route runs server-side. Validates the request body with a typed schema before responding. Refuses default exports, bare object returns, returning data without Response wrapper, and Node-only APIs in routes intended for both web and native.

Install

npx vskill@latest install roninforge/roninforge-expo/expo-new-api-route

SKILL.md

The same SKILL.md was published earlier as roninforge/roninforge-expo/expo-new-api-route.

expo-new-api-route

Use when the user asks for "an API endpoint", "a server route", or "a backend handler" inside an Expo Router project.

Prerequisite

app.config.ts must set:

ts
web: { bundler: "metro", output: "server" }

Without it, the +api.ts files are not compiled into the server bundle.

File path

API routes live at app/api/<name>+api.ts. The URL is /api/<name>.

FilenameURL
app/api/health+api.ts/api/health
app/api/posts/[id]+api.ts/api/posts/:id

Template

ts
// app/api/posts/[id]+api.ts
type Post = { id: string; title: string };
export async function GET(req: Request, { id }: { id: string }) {
const post: Post = { id, title: `Post ${id}` };
return Response.json(post);
}
export async function PUT(req: Request, { id }: { id: string }) {
const body = (await req.json()) as Partial<Post>;
if (typeof body.title !== "string" || body.title.length === 0) {
return new Response(JSON.stringify({ error: "title required" }), {
status: 400,
headers: { "content-type": "application/json" },
});
}
return Response.json({ id, title: body.title } satisfies Post);
}
export async function DELETE(req: Request, { id }: { id: string }) {
return new Response(null, { status: 204 });
}

Refuses

  • export default function handler(...) (must export named GET/POST/PUT/DELETE)
  • return { ok: true } (must return a Response object)
  • Using fs, path, or Node-only APIs without confirming the server runtime supports them
  • Calling client-only Expo modules (expo-camera, expo-image) from inside a +api.ts
  • Reading secrets from EXPO_PUBLIC_* (use plain process.env.X server-side)

After scaffolding

Remind the user to deploy with eas deploy (or their hosting target) and that API routes do not run in the native mobile bundle (mobile clients call the deployed server URL).

Source: https://docs.expo.dev/router/reference/api-routes/

Security

  • Security scanPassed, 95 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/roninforge/roninforge-expo/expo-new-api-route/badge)](https://verified-skill.com/skills/roninforge/roninforge-expo/expo-new-api-route)

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