Skip to content
Discussion options

You must be logged in to vote

From the FastAPI project-generator codebase:

# app/api/api_v1/endpoints/items.py
...

from fastapi import APIRouter, Depends, HTTPException

...

router = APIRouter()


@router.get("/", response_model=List[Item])
...
# app/api/api_v1/api.py
from fastapi import APIRouter

from app.api.api_v1.endpoints import items, login, users, utils

api_router = APIRouter()
api_router.include_router(login.router, tags=["login"])
api_router.include_router(users.router, prefix="/users", tags=["users"])
api_router.include_router(utils.router, prefix="/utils", tags=["utils"])
api_router.include_router(items.router, prefix="/items", tags=["items"])
# app/main.py
from fastapi import FastAPI

...

from app.api.a…

Replies: 9 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by YuriiMotov
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@alv2017
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
6 participants
Converted from issue

This discussion was converted from issue #386 on February 28, 2023 12:24.