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

FastAPI系列 10-路由管理APIRouter

  • FastAPI系列 10-路由管理APIRouter
    • 前言
    • 一、路由管理 APIRouter
    • 二、FastAPI 主体
    • 总结




FastAPI系列 10-路由管理APIRouter

前言

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

一、路由管理 APIRouter

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

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

app 目录

你可能感兴趣的:(#,python,python,fastapi,网络)