Getting Started
wooter is runtime-agnostic. You define routes and call fetch.
Install Or Import
Section titled “Install Or Import”JSR (recommended)
Section titled “JSR (recommended)”deno add jsr:@bronti/wooternpm projects (via JSR CLI)
Section titled “npm projects (via JSR CLI)”npx jsr add @bronti/wooterESM URL via esm.sh
Section titled “ESM URL via esm.sh”import { c, Wooter } from "https://esm.sh/jsr/@bronti/wooter"First Router
Section titled “First Router”import { c, Wooter } from "@bronti/wooter"
const router = new Wooter()
router.route(c.chemin(), "GET", ({ resp }) => { resp(new Response("hello"))})
router.route(c.chemin("posts", c.pNumber("id")), "GET", ({ params, resp }) => { resp.json({ postId: params.get("id") })})
export default routerMethod Maps
Section titled “Method Maps”You can provide per-method handlers in one route declaration.
router.route(c.chemin("posts"), { GET: ({ resp }) => resp.json([{ id: 1 }]), POST: ({ resp }) => resp(new Response(null, { status: 201 })),})Next Steps
Section titled “Next Steps”- Learn runtime mounting patterns in Hosting And Runtimes.
- Learn the lifecycle model in Core Concepts.
- Learn control helpers in Middleware.
- Read all exports in API Overview.