uvicorn: add page (#4217)

client-spec/clarity
Giorgio Vilardo 2020-07-24 22:00:36 +02:00 committed by GitHub
parent 0f879b6049
commit 22577ba810
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 24 additions and 0 deletions

24
pages/common/uvicorn.md Normal file
View File

@ -0,0 +1,24 @@
# uvicorn
> Python ASGI HTTP Server, for asynchronous projects.
> More information: <https://www.uvicorn.org/>.
- Run Python web app:
`uvicorn {{import.path:app_object}}`
- Listen on port 8080 on localhost:
`uvicorn --host {{localhost}} --port {{8080}} {{import.path:app_object}}`
- Turn on live reload:
`uvicorn --reload {{import.path:app_object}}`
- Use 4 worker processes for handling requests:
`uvicorn --workers {{4}} {{import.path:app_object}}`
- Run app over HTTPS:
`uvicorn --ssl-certfile {{cert.pem}} --ssl-keyfile {{key.pem}} {{import.path:app_object}}`