快速使用 FastAPI开发网络数据接口
# FastAPI开发网络数据接口# Author: 大冰from fastapi import FastAPIimport uvicornapp = FastAPI()@app.get('/')def say_hello():return {'code': 200, 'message' : 'hello, fastAPI'}if __name__ == '__main__':# 我的文件名为te
·
# FastAPI开发网络数据接口
# Author: 大冰
from fastapi import FastAPI
import uvicorn
app = FastAPI()
@app.get('/')
def say_hello():
return {'code': 200, 'message' : 'hello, fastAPI'}
if __name__ == '__main__':
# 我的文件名为test,所以下面的参数app = ‘test:app’
uvicorn.run(app='test:app', host="127.0.0.1", port=8000, reload=True, debug=True)
更多推荐



所有评论(0)