wix-cli-backend-api

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

Updated Mar 30, 2026
One-click install
npx skills add https://github.com/nirganon/nir-beauty --skill wix-cli-backend-api-nirganon
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: wix-cli-backend-api
Source: https://github.com/nirganon/nir-beauty/tree/main/.agents/skills/wix-cli-backend-api
Command: npx skills add https://github.com/nirganon/nir-beauty --skill wix-cli-backend-api-nirganon

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 - HTTP Endpoint Creation: Generates TypeScript endpoint files in src/pages/api/ with typed APIRoute handlers for GET, POST, and other HTTP methods. - Request Handling Patterns: Covers path parameters via dynamic routes, query strings, JSON body parsing, headers, and standardized response status codes. - Frontend Integration: Shows how to call endpoints from frontend components using Wix's httpClient.fetchWithAuth(). - Use Case: You need a REST API to handle form submissions in your Wix app. This Skill creates src/pages/api/submissions.ts with validated POST handling, proper error responses, and frontend fetch code. ## Quick Start Create a backend HTTP endpoint for my Wix CLI app that handles POST requests with JSON body validation.

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 handle dynamic route parameters in Wix API endpoints?

Use square brackets in filenames, such as src/pages/api/users/[id].ts, which maps to /api/users/:id. Access the parameter via the params object in your APIRoute handler and validate it before use.

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 handles authentication automatically.

Can I add Wix HTTP endpoints using the CLI generate command?

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 extension registration.

How do I deploy Wix HTTP endpoints to production?

Run the build command, optionally create preview URLs for testing, then use the release command. Once released, endpoints handle live traffic at production URLs, and deleting the file plus re-releasing removes an endpoint.