python系列:FastAPI系列 10-路由管理APIRouter




FastAPI系列 10-路由管理APIRouter

前言

fastapi 中也有类似的功能通过APIRouter 来管理

一、路由管理 APIRouter

正在开发一个应用程序或 Web API,很少会将所有的内容都放在一个文件中。FastAPI 提供了一个方便的工具,可以在保持所有灵活性的同时构建你的应用程序。

├── fastapi
│   ├── __init__.py
│   ├── main.py
│   └── routers
│   │   ├── __init__.py
│   │   ├── users.py
│   │   └── books.py

app 目录

posted @ 2024-06-03 17:37  坦笑&&life  阅读(76)  评论(0)    收藏  举报  来源