wix-cli-backend-api

Creates HTTP endpoints for Wix CLI apps using Astro API routes.

Updated Apr 9, 2026
One-click install
npx skills add https://github.com/yaelbro/Shelf-Control --skill wix-cli-backend-api-yaelbro
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: wix-cli-backend-api
Source: https://github.com/yaelbro/Shelf-Control/tree/main/.agents/skills/wix-cli-backend-api
Command: npx skills add https://github.com/yaelbro/Shelf-Control --skill wix-cli-backend-api-yaelbro

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Building server-side logic for Wix CLI apps requires knowing the file-based routing conventions, Astro endpoint patterns, and Wix-specific deployment workflow. This Skill provides the exact patterns for creating backend HTTP endpoints without guesswork. ## Core Features & Use Cases - File-Based Endpoint Creation: Define REST API routes by placing TypeScript files in src/pages/api/, with support for dynamic route parameters like [id].ts. - Full HTTP Method Support: Implement GET, POST, PUT, PATCH, and DELETE handlers typed with Astro's APIRoute, including request body parsing, query parameters, and headers. - Standardized Responses: Return proper Response objects with correct status codes (200, 201, 204, 400, 404, 500) and JSON content types. - Use Case: You need a backend endpoint that receives form submissions from your Wix app's frontend, validates the payload, and stores it server-side. This Skill generates the endpoint file and shows how to call it from the frontend using httpClient.fetchWithAuth(). ## Quick Start Create a backend HTTP endpoint in my Wix CLI app that accepts POST requests with JSON data at /api/submissions.

Frequently Asked Questions about wix-cli-backend-api

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

FAQPage Schema
How do I create a backend HTTP endpoint in a Wix CLI app?

Create a TypeScript file in src/pages/api/ and export named functions for each HTTP method, typed with APIRoute from astro. The file path determines the endpoint URL, and endpoints are auto-discovered without registration.

How do I add dynamic route parameters to Wix API endpoints?

Use square brackets in the filename, such as src/pages/api/users/[id].ts, which maps to /api/users/:id. Access the parameter inside the handler via the params object destructured from the APIRoute context.

How do I call a Wix backend endpoint from the frontend?

Use httpClient.fetchWithAuth() from @wix/essentials with the endpoint URL derived from import.meta.url origin. It supports GET and POST requests with JSON bodies and returns standard fetch Response objects.

Can I add Wix HTTP endpoints using npm run generate?

No, HTTP endpoints cannot be added via npm run generate. You create the files directly under src/pages/api/, and they are automatically discovered from the file system without appearing on the Extensions page.

How do I deploy Wix CLI HTTP endpoints to production?

Run the build command, optionally create preview URLs for testing, then run the release command. Once released, endpoints handle live traffic at production URLs; deleting the file and releasing again removes the endpoint.