backend

Create server-side API routes and backend endpoints for Astro projects.

Updated Mar 24, 2026
One-click install
npx skills add https://github.com/Wahidul123/med-plus-hub --skill backend-wahidul123
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: backend
Source: https://github.com/Wahidul123/med-plus-hub/tree/main/.emdash/skills/backend
Command: npx skills add https://github.com/Wahidul123/med-plus-hub --skill backend-wahidul123

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Astro server-side API routes and backend endpoints enable developers to implement REST APIs, form handling, and server-side logic within Astro apps.

Core Features & Use Cases

  • API routing under src/pages/api for server endpoints
  • HTTP method handlers export (GET, POST, PUT, DELETE, PATCH)
  • Type-safe with Astro's APIRoute types

Quick Start

Create an API endpoint under src/pages/api to expose server-side logic for your Astro app.

Frequently Asked Questions about backend

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

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

Astro server-side API routes are created by exporting HTTP method handlers like GET, POST, PUT, DELETE, and PATCH from TypeScript files located in the src/pages/api/ directory. Each handler returns a standard Response object.

Can I build a REST API with Astro endpoints?

Yes, you can build a REST API with Astro endpoints by defining HTTP method handlers under src/pages/api. This approach supports server-side logic, form submissions, and returns standard responses for client requests.

How do I handle form submissions on the server in Astro?

Astro server-side endpoints handle form submissions by exporting a POST handler within a src/pages/api file. The handler processes the incoming request data and returns a standard HTTP Response.

Are Astro backend API routes type-safe?

Astro backend API routes are type-safe using Astro's APIRoute types. This provides TypeScript safety for server-side logic and ensures correctly typed inputs and outputs for your HTTP method handlers.

What HTTP methods can I export from Astro API endpoints?

Astro API endpoints support exporting GET, POST, PUT, DELETE, and PATCH HTTP method handlers. Each exported function processes its respective request type and returns a standard Response.