Add FastAPI wechat app: config, wechat handler, run scripts, requirements, env template
This commit is contained in:
1 parent
b193b29e3a
commit
a2185104ad
8 files changed
+249
-7
No files matched your search
@@ -0,0 +1,20 @@
|
||||
"""
|
||||
服务器部署启动脚本
|
||||
|
||||
使用方法:
|
||||
source venv/bin/activate
|
||||
python run_server.py
|
||||
|
||||
或者配成 systemd 服务(后面会做)
|
||||
"""
|
||||
|
||||
import uvicorn
|
||||
|
||||
if __name__ == "__main__":
|
||||
uvicorn.run(
|
||||
"wechat:app",
|
||||
host="127.0.0.1", # 只监听本地,由 Nginx 反向代理
|
||||
port=8000,
|
||||
reload=False, # 生产不开 reload
|
||||
workers=1, # 2G 内存跑 1 个 worker 够了
|
||||
)
|
||||
Reference in new issue
Block a user