python_template_server.routers.base_router¶
Base router for the FastAPI server.
Classes
|
Abstract base class for API routers. |
- class python_template_server.routers.base_router.BaseRouter(prefix)[source]¶
Abstract base class for API routers.
- configure(hashed_token, limiter, rate_limit)[source]¶
Configure the router with shared dependencies.
- add_route(endpoint, handler_function, response_model, methods, limited, authentication_required)[source]¶
Add an API route.
- Parameters:
endpoint (
str) – The API endpoint pathhandler_function (
Callable) – The handler function for the endpointresponse_model (
type[BaseModel] |None) – The Pydantic model for the responselimited (
bool) – Whether to apply rate limiting to this routeauthentication_required (
bool) – Whether authentication is required for this route
- Return type: