已有的项目是基于FASTAPI框架 开发的https://github.com/tiangolo/fastapi
如何迁移到云开发
查看文档 https://help.aliyun.com/document_detail/183365.html?spm=a2c4g.11186623.6.578.49e6388chHya1p
main.py
from typing import Optional import uvicorn from fastapi import FastAPI
app = FastAPI()
@app.get("/") def read_root(): return {"Hello": "World"}
@app.get("/items/{item_id}") def read_item(item_id: int, q: Optional[str] = None): return {"item_id": item_id, "q": q}
if name == 'main':
uvicorn.run(app='main:app', host='0.0.0.0',port=8020, debug=False, reload=True)
测试报错 erver Error: [2020-11-17 11:19:21 +0000] [1383] [ERROR] Error handling request / Traceback (most recent call last): File "/home/admin/.local/lib/python3.6/site-packages/gunicorn/workers/sync.py", line 134, in handle self.handle_request(listener, req, client, addr) File "/home/admin/.local/lib/python3.6/site-packages/gunicorn/workers/sync.py", line 175, in handle_request respiter = self.wsgi(environ, resp.start_response) TypeError: call() missing 1 required positional argument: 'send'
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。