Skip to content

Commit

Permalink
docs: update router module doc
Browse files Browse the repository at this point in the history
  • Loading branch information
kitsonk committed Mar 1, 2024
1 parent 7693dae commit 6a41fff
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions router.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
/**
* Contains the router of oak. Typical usage is the creation of an application
* instance, the creation of a router instance, registration of route
* middleware, registration of router with the application, and then starting to
* listen for requests.
*
* # Example
*
* ```ts
* import { Application } from "jsr:@oak/oak@14/application";
* import { Router } from "jsr:@oak/oak@14/router";
*
* const app = new Application();
* const router = new Router();
* router.get("/", (ctx) => {
* ctx.response.body = "hello world!";
* });
* app.use(router.routes());
* app.use(router.allowedMethods());
*
* app.listen();
* ```
*
* @module
*/

/**
* Adapted directly from @koa/router at
* https://github.com/koajs/router/ which is licensed as:
Expand Down Expand Up @@ -25,32 +51,6 @@
* THE SOFTWARE.
*/

/**
* Contains the router of oak. Typical usage is the creation of an application
* instance, the creation of a router instance, registration of route
* middleware, registration of router with the application, and then starting to
* listen for requests.
*
* # Example
*
* ```ts
* import { Application } from "jsr:@oak/oak@14/application";
* import { Router } from "jsr:@oak/oak@14/router";
*
* const app = new Application();
* const router = new Router();
* router.get("/", (ctx) => {
* ctx.response.body = "hello world!";
* });
* app.use(router.routes());
* app.use(router.allowedMethods());
*
* app.listen();
* ```
*
* @module
*/

import type { State } from "./application.ts";
import type { Context } from "./context.ts";
import {
Expand Down

0 comments on commit 6a41fff

Please sign in to comment.