Skip to content

API Overview

jsr:@bronti/wooter exports:

  • Wooter
  • c (chemin helpers)
  • use and middleware
  • Option
  • Result
  • Error exports (WooterError, ControlFlowBreak, type guards, lifecycle errors)
  • Response helpers (makeRedirect, makeError)
  • Public TypeScript types

From deno.jsonc:

  • . -> main public API
  • ./chemin
  • ./option
  • ./result
  • ./types
  • ./error
  • ./response
  • ./use

Wooter<TData, TParentParams> is the main typed router.

Core methods:

  • route(path, method, handler)
  • route(path, methodMap)
  • use(middleware)
  • router(basePath)
  • notFound(handler)
  • fetch(request)

Response helpers:

makeRedirect(location, init?)
makeError(status, message?, headers?)

Middleware helper:

middleware<TNextData>(handler)

Handler wrapper helper:

use(middlewareHandler, routeHandler)

For full API symbols and signatures, see the hosted API docs: https://jsr.io/@bronti/wooter/doc