Skip to content

Commit

Permalink
Update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
timonson committed Mar 30, 2022
1 parent 8b40eb6 commit 4007c75
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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...
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions portal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class Portal<S extends State = DefaultState> {
* 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);
Expand All @@ -61,7 +61,7 @@ export class Portal<S extends State = DefaultState> {
* 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");
Expand Down

0 comments on commit 4007c75

Please sign in to comment.