1 Star 0 Fork 0

binyu/fastapiLearn

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
01quickStart.py 530 Bytes
一键复制 编辑 原始数据 按行查看 历史
# -*- coding: utf-8 -*-
# @File : 01quickStart.py
# @Author: liubinyu
# @Time: 2024/5/19 10:17
import uvicorn
from fastapi import FastAPI # FastAPI 是一个为你的 API 提供了所有功能的 Python 类。
app = FastAPI() # 这个实例将是创建你所有 API 的主要交互对象。这个 app 同样在如下命令中被 uvicorn 所引用
@app.get("/")
async def root():
return {"message": "Hello World!"}
if __name__ == '__main__':
uvicorn.run("01quickStart:app", host="127.0.0.1", port=8080, reload=True)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/liubinyu19930105/fastapi-learn.git
git@gitee.com:liubinyu19930105/fastapi-learn.git
liubinyu19930105
fastapi-learn
fastapiLearn
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385