信息系统分析与设计1(0305)
·
安装环境
# 在激活的default_env环境中安装uvicorn
pip install uvicorn
# 如果是FastAPI项目,通常还需要安装fastapi
pip install fastapi

创建项目
在项目下创建mian.py文件
from fastapi import FastAPI
app=FastAPI()
# app.include_router('router')
@app.get('/')
async def root():
return {"message":"Hello World"}

启动
uvicorn main:app --reload


更多推荐
所有评论(0)