Skip to main content
Module

x/oak_sessions/deps.ts>Router#routes

Session middleware for Oak
Go to Latest
method Router.prototype.routes
import { Router } from "https://deno.land/x/oak_sessions@v4.0.0/deps.ts";

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 "https://deno.land/x/oak/mod.ts";

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

// register routes

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

Returns

Middleware