📝 Clarify routes.router
This commit is contained in:
parent
0941a9e9d6
commit
1bcd7c0f1f
2 changed files with 10 additions and 5 deletions
|
|
@ -126,9 +126,10 @@ from ohmyapi.db.exceptions import DoesNotExist
|
|||
|
||||
from .models import Tournament
|
||||
|
||||
# If <app>.routes.router exists and is an APIRouter, OhMyAPI will
|
||||
# automatically pick it up and add it to the app's main APIRouter.
|
||||
router = APIRouter(prefix="/tournament")
|
||||
# Expose your app's routes via `router = fastapi.APIRouter`.
|
||||
# Use prefixes wisely to avoid cross-app namespace-collisions.
|
||||
# Tags improve the UX of the OpenAPI docs at /docs.
|
||||
router = APIRouter(prefix="/tournament", tags=['Tournament'])
|
||||
|
||||
|
||||
@router.get("/")
|
||||
|
|
|
|||
|
|
@ -1,11 +1,15 @@
|
|||
from ohmyapi.router import APIRouter
|
||||
|
||||
from . import models
|
||||
|
||||
router = APIRouter(prefix="/{{ app_name }}")
|
||||
# Expose your app's routes via `router = fastapi.APIRouter`.
|
||||
# Use prefixes wisely to avoid cross-app namespace-collisions.
|
||||
# Tags improve the UX of the OpenAPI docs at /docs.
|
||||
router = APIRouter(prefix="/{{ app_name }}", tags=[{{ app_name }}])
|
||||
|
||||
|
||||
@router.get("/")
|
||||
def ping():
|
||||
def hello_world():
|
||||
return {
|
||||
"project": "{{ project_name }}",
|
||||
"app": "{{ app_name }}",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue