Python FASTAPI 的 serverless_config 如何设置?
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'
赞0
踩0