mirror of
https://github.com/fastapi-practices/fastapi-best-architecture.git
synced 2026-09-21 13:12:24 +00:00
Add router jinja template for code generation (#1031)
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
from fastapi import APIRouter
|
||||
|
||||
from backend.app.{{ app_name }}.api.{{ api_version }}.{{ filename }} import router as {{ table_name }}_router
|
||||
from backend.core.conf import settings
|
||||
|
||||
v1 = APIRouter(prefix=settings.FASTAPI_API_V1_PATH{% if tag %}, tags=['{{ tag }}']{% endif %})
|
||||
|
||||
v1.include_router({{ table_name }}_router, prefix='/{{ table_name.replace('_', '-') }}s')
|
||||
Reference in New Issue
Block a user