Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
manatlan committed Jun 4, 2024
1 parent 56bdbd7 commit 1109db2
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,28 @@ By default, it's `0` (process lives as long as the server lives).
IMPORTANT : the "tag.update" feature doesn't reset the inactivity timeout !


### to add an endpoint (add_route)

Example to add a static endpoint :

```python
async def serve(req):
return open("...","r").read()

app=Runner( App, debug=False, ssl=True )
app.add_route("/my.css", serve)
```

Example to add another htag app on another endpoint :

```python
async def serve(req):
return await req.app.handle(req, App2 )

app=Runner( App, debug=False, ssl=True )
app.add_route("/my_other_app", serve)
```


-------------------------------

Expand Down

0 comments on commit 1109db2

Please sign in to comment.