安装需要的包
pip install gunicorn uvicorn greenlet eventlet gevent
后台代码
Server.py 文件中有app 变量
启动
# http 服务 timeout 单位s
gunicorn -k uvicorn.workers.UvicornWorker Server:app --bind 0.0.0.0:5665 --workers 2 --timeout 100
# https 服务
gunicorn -k uvicorn.workers.UvicornWorker --certfile=./configs/a.pem --keyfile=./configs/a-key.pem Server:app --bind 0.0.0.0:5665 --workers 2 --timeout 520

最低0.47元/天 解锁文章
1675

被折叠的 条评论
为什么被折叠?



