2022-11-08 13:07:18 +00:00
|
|
|
async def app(scope, receive, send):
|
2022-11-16 19:28:46 +00:00
|
|
|
assert scope["type"] == "http"
|
2022-11-08 13:07:18 +00:00
|
|
|
|
2022-11-16 19:28:46 +00:00
|
|
|
await send(
|
|
|
|
{
|
|
|
|
"type": "http.response.start",
|
|
|
|
"status": 200,
|
|
|
|
"headers": [
|
|
|
|
[b"content-type", b"text/plain"],
|
|
|
|
],
|
|
|
|
}
|
|
|
|
)
|
|
|
|
await send(
|
|
|
|
{
|
|
|
|
"type": "http.response.body",
|
|
|
|
"body": b"Hello, world!",
|
|
|
|
}
|
|
|
|
)
|
2022-11-08 13:07:18 +00:00
|
|
|
|
2022-11-16 19:28:46 +00:00
|
|
|
|
|
|
|
# python3 -m gunicorn uvicorn_guvicorn_plaintext:app -w 1 -k uvicorn.workers.UvicornWorker
|
|
|
|
# pypy3 -m gunicorn uvicorn_guvicorn_plaintext:app -w 1 -k uvicorn.workers.UvicornWorker
|