x/oak/router.ts

A middleware framework for handling HTTP with Deno, Node, Bun and Cloudflare Workers 🐿️ 🦕
Very Popular
Latest
method Router.prototype.routes
import { Router } from "https://dotland-vbqsvsrpfncg.deno-staging.dev/x/oak@v17.1.3/router.ts?p=prototype.routes&s=Router";

Return middleware that will do all the route processing that the router has been configured to handle. Typical usage would be something like this:

import { Application, Router } from "jsr:@oak/oak/";

const app = new Application();
const router = new Router();

// register routes

app.use(router.routes());
app.use(router.allowedMethods());
await app.listen({ port: 80 });