Skip to content

Commit

Permalink
docs: add documentation for add_route
Browse files Browse the repository at this point in the history
  • Loading branch information
Ido Slonimsky committed Sep 7, 2023
1 parent 7826a98 commit 0bfad10
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,18 @@ app.add_view("/", View)

```

## Route Registration

Instead of using the decorators, you can also add routes with a function:

```python
async def hello(request):
return "Hello World"

app.add_route("GET", "/hello", hello)
```

This works for all HTTP methods.

## Allow CORS

Expand Down

0 comments on commit 0bfad10

Please sign in to comment.