📝 Clarify routes.router

This commit is contained in:
Brian Wiborg 2025-09-27 15:59:33 +02:00
parent 0941a9e9d6
commit 1bcd7c0f1f
No known key found for this signature in database
2 changed files with 10 additions and 5 deletions

View file

@ -126,9 +126,10 @@ from ohmyapi.db.exceptions import DoesNotExist
from .models import Tournament from .models import Tournament
# If <app>.routes.router exists and is an APIRouter, OhMyAPI will # Expose your app's routes via `router = fastapi.APIRouter`.
# automatically pick it up and add it to the app's main APIRouter. # Use prefixes wisely to avoid cross-app namespace-collisions.
router = APIRouter(prefix="/tournament") # Tags improve the UX of the OpenAPI docs at /docs.
router = APIRouter(prefix="/tournament", tags=['Tournament'])
@router.get("/") @router.get("/")

View file

@ -1,11 +1,15 @@
from ohmyapi.router import APIRouter from ohmyapi.router import APIRouter
from . import models 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("/") @router.get("/")
def ping(): def hello_world():
return { return {
"project": "{{ project_name }}", "project": "{{ project_name }}",
"app": "{{ app_name }}", "app": "{{ app_name }}",