From 4007c75c49a11bade0179cdb895b4b49e0fd33ea Mon Sep 17 00:00:00 2001 From: timonson Date: Wed, 30 Mar 2022 13:31:21 +0200 Subject: [PATCH] Update doc --- README.md | 4 ++-- portal.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2e6a627..450d30d 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ Creates routing functions. ```ts const getAndPost = app.add("GET", "POST"); -getAndPost("/getorpost/*", (ctx) => new Response("Hello")); +getAndPost({ pathname: "/path/*" }, (ctx) => new Response("Hello")); ``` ##### get, post, delete, connect... @@ -90,7 +90,7 @@ Takes a `URLPatternInput` and one or multiple `Handlers`. It applies the `Handlers` to the named HTTP method and the specified route. ```ts -app.get("*", (ctx) => new Response("Hello")); +app.get({ pathname: "*" }, (ctx) => new Response("Hello")); ``` ##### use diff --git a/portal.ts b/portal.ts index 8da28dd..1bec60e 100644 --- a/portal.ts +++ b/portal.ts @@ -51,7 +51,7 @@ export class Portal { * Creates routing functions. * ```ts * const getAndPost = app.add("GET", "POST"); - * getAndPost("/getorpost/*", (ctx) => new Response("Hello")); + * getAndPost({ pathname: "/path/*" }, (ctx) => new Response("Hello")); * ``` */ add = this.addRoutes(this.routes); @@ -61,7 +61,7 @@ export class Portal { * Takes a `URLPatternInput` and one or multiple `Handlers`. It applies the * `Handlers` to the named HTTP method and the specified route. * ```ts - * app.connect("*", (ctx) => new Response("Hello")); + * app.connect({ pathname: "*" }, (ctx) => new Response("Hello")); * ``` */ connect = this.add("CONNECT");