mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-02-02 19:43:11 +00:00
30 lines
668 B
Plaintext
30 lines
668 B
Plaintext
---
|
|
syntax: markdown
|
|
tags: [tldr, common]
|
|
source: https://github.com/tldr-pages/tldr.git
|
|
---
|
|
# 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}}`
|