stacks-router

Define HTTP routes, middleware, and route groups for Stacks applications.

622|17|Updated Apr 26, 2022
One-click install
npx skills add https://github.com/stacksjs/stacks --skill stacks-router
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: stacks-router
Source: https://github.com/stacksjs/stacks/tree/main/.claude/skills/stacks-router
Command: npx skills add https://github.com/stacksjs/stacks --skill stacks-router

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Define and manage HTTP routes, middleware, and route groups for Stacks applications.

Core Features & Use Cases

  • Route definitions (get/post/put/patch/delete) across routes files like routes/api.ts and app/Routes.ts
  • Route groups with prefixes and middleware
  • Middleware integration and chainable method support
  • URL generation and enhanced request/response helpers
  • Default API routes and server integration using Bun-router

Quick Start

Define your routing structure in the routes files and start the server to expose endpoints.

Frequently Asked Questions about stacks-router

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

FAQPage Schema
How do I define HTTP routes and middleware for a Stacks application?

Route groups in Stacks applications allow you to organize related endpoints by applying shared prefixes and middleware. You define these groups in your routes files to manage routing structures efficiently and reduce repetitive configuration.

Can I use Bun-router to manage API routes and generate URLs?

Yes, Bun-router provides the underlying server integration for your Stacks application routing. The router supports default API routes, URL generation, and enhanced request and response helpers to expose your endpoints.

How do I set up route model binding and error responses for web APIs?

Route model binding and error responses are supported directly within the Stacks router. You configure these features in your route definitions to automatically resolve models and return appropriate error responses for your web APIs and admin dashboards.

What's the best way to structure route files for admin dashboards and APIs?

The best way to structure route files for admin dashboards and APIs is using dedicated routes files like routes/api.ts and app/Routes.ts. You separate concerns by defining route groups with specific prefixes and middleware for each application area.

Why are my Stacks routes not working after adding new middleware?

Stacks routes might fail after adding middleware due to incorrect chainable method support or route group configuration issues. Verify your middleware integration and ensure route definitions are correctly registered in the route registry.