Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/hex/src/fw/service/deps.ts>oak.Router#routes

An ecosystem delivering practices, philosophy and portability. Powered By Deno and JavaScript.
Go to Latest
method oak.Router.prototype.routes
import { oak } from "https://deno.land/x/hex@0.6.3/src/fw/service/deps.ts";
const { Router } = oak;

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 });