rwsdk-routing-middleware

Define structured routing and middleware pipelines for rwsdk Cloudflare Workers apps.

Updated Dec 26, 2025
One-click install
npx skills add https://github.com/kcc989/logoer --skill rwsdk-routing-middleware
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rwsdk-routing-middleware
Source: https://github.com/kcc989/logoer/tree/main/.claude/skills/rwsdk-routing
Command: npx skills add https://github.com/kcc989/logoer --skill rwsdk-routing-middleware

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a ready-to-use routing and middleware framework for rwsdk-based Cloudflare Workers apps, enabling structured route handling, authentication guards, shared context, and type-safe link generation without boilerplate.

Core Features & Use Cases

  • DefineApp-based routing: create an ordered array of middleware and route handlers to manage requests.
  • Interrupters for guards: add per-route or per-method checks to short-circuit unauthorized access.
  • Context sharing & Document rendering: populate a per-request ctx and wrap responses in Document for consistent HTML or React Server Components rendering.
  • Type-safe linking: generate links with compile-time validation of routes and parameters.

Quick Start

Create a small rwsdk app by importing defineApp, route, and render, then export default defineApp([...]) with a simple middleware and a couple of routes.

Frequently Asked Questions about rwsdk-routing-middleware

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

FAQPage Schema
How do I set up routing and middleware in a Cloudflare Workers app?

Set up routing and middleware in Cloudflare Workers by importing defineApp, route, and render, then exporting defineApp with an ordered array of middleware and route handlers to sequentially process incoming requests.

How do I add authentication guards to Cloudflare Workers routes?

Add authentication guards to Cloudflare Workers routes by configuring interrupters, which perform per-route or per-method checks to short-circuit unauthorized access before the main route handler executes.

How do I share request context across middleware in rwsdk?

Share request context across middleware in rwsdk by populating a per-request ctx object, passing shared data sequentially through the ordered pipeline before wrapping responses in a Document for rendering.

Can I generate type-safe links for routes in Cloudflare Workers?

Yes, you can generate type-safe links for routes in Cloudflare Workers, utilizing compile-time validation of route patterns and parameters to prevent broken links and ensure parameter accuracy.

Does this routing middleware support HTML and React Server Components rendering?

Yes, this routing middleware supports HTML and React Server Components rendering by wrapping route responses in a Document wrapper to ensure consistent layout and rendering output across the application.

What is the best way to structure ordered route matching without boilerplate?

The best way to structure ordered route matching without boilerplate is using defineApp to declare an ordered array of middleware and route handlers, applying sequential matching and interrupter guards automatically.