backend

Automate server-side API route setup in Astro projects with typed HTTP method handlers.

Updated Mar 5, 2026
One-click install
npx skills add https://github.com/vipulj226-design/lordmahaveerabirthplace --skill backend-vipulj226-design
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: backend
Source: https://github.com/vipulj226-design/lordmahaveerabirthplace/tree/main/.emdash/skills/backend
Command: npx skills add https://github.com/vipulj226-design/lordmahaveerabirthplace --skill backend-vipulj226-design

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Astro projects often struggle with organizing server-side routes, keeping API patterns consistent, and clearly documenting backend conventions. This Skill provides a standardized guide to building and documenting Astro server-side API routes using src/pages/api with explicit HTTP method handlers.

Core Features & Use Cases

  • API Route Convention: place all API endpoints under src/pages/api to maintain separation from client pages.
  • HTTP Method Handlers: each API file exports GET/POST/PUT/DELETE handlers.
  • Wix SDK Compatibility: demonstrates using Wix SDKs in server endpoints.
  • Examples: hello.ts, /api/users to illustrate typical patterns.

Quick Start

Create a simple API endpoint at src/pages/api/hello.ts that responds with a JSON hello message.

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 an Astro project?

To create server-side API routes in Astro, place endpoint files under the src/pages/api directory and export typed HTTP method handlers like GET, POST, PUT, and DELETE to process requests and return JSON responses.

How do I organize REST endpoints in Astro to separate them from client pages?

To organize REST endpoints in Astro, place all API files under src/pages/api. This maintains a clear separation between backend server logic and frontend client pages, ensuring consistent API patterns across the project.

Can I use TypeScript to define HTTP method handlers for Astro backend endpoints?

Yes, you can use TypeScript to define HTTP method handlers for Astro backend endpoints. You export typed GET, POST, PUT, and DELETE functions from files in src/pages/api to handle requests and structure server logic.

How do I integrate Wix SDKs into Astro server endpoints?

To integrate Wix SDKs into Astro server endpoints, you import and use the SDKs within your exported HTTP method handlers in the src/pages/api directory to interact with Wix backend services server-side.

What is the best way to build a REST-like API with Astro?

The best way to build a REST-like API with Astro is to use the src/pages/api directory convention, exporting explicit HTTP method handlers for each endpoint to ensure standardized backend routing and clear server-side logic documentation.

Do I need to configure SSR to handle API requests in Astro?

Handling API requests in Astro requires considering server-side rendering (SSR) configurations, as backend endpoints process server logic and interact with HTTP requests dynamically rather than serving static client-side content.