Skip to content

Commit

Permalink
docs: updated context docs (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeCheneler authored Nov 21, 2024
1 parent d10ab76 commit 5818e02
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,27 @@ context.cookies.set("name", "value");
context.cookies.delete("name");
```

### Parameters

Parameters are parsed from the URL and placed on the context.

```tsx
// /user/:id/post/:postId -> /user/1/post/2

context.params.id; // 1
context.params.postId; // 2
```

### Wildcards

Wildcards are parsed from the URL and placed on the context.

```tsx
// /public/* -> /public/one/two/three

context.wildcard; // one/two/three
```

## Routing

### HTTP methods
Expand Down
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mage/server",
"version": "0.7.1",
"version": "0.7.2",
"license": "MIT",
"exports": "./mod.ts",
"tasks": {
Expand Down

0 comments on commit 5818e02

Please sign in to comment.