import { type RouteOptions } from "https://deno.land/x/acorn@0.0.11/router.ts";
Options that can be specified when adding a route to the router.
Properties
optional
deserializer: Deserializer<BodyType, Params>An optional deserializer to use when decoding the body. This can be used to validate the body of the request or hydrate an object.
An error handler which is specific to this route, which will be called when there is an error thrown when trying to process the route.
optional
serializer: Serializer<Params>The serializer is used to serialize a return value of the route handler,
when the value is not a Response
or BodyInit
. The
optional .stringify()
method of the serializer is expected to return a
JSON string representation of the body returned from the handler, where as
the .toResponse()
method is expected to return a full
Response
object.