Spaces:
Sleeping
Sleeping
Download api/__init__.py from RocketFarmStudios/CPS-API: direct link, hf CLI and curl.
- Browser
- Download file 768 Bytes
-
https://huggingface.co/spaces/RocketFarmStudios/CPS-API/resolve/e9ae3aeb6d4d2dbd87828c0d4514e2a4e7f71d8a/api/__init__.py
- Command line
-
hf download hf://spaces/RocketFarmStudios/CPS-API@e9ae3aeb6d4d2dbd87828c0d4514e2a4e7f71d8a/api/__init__.py
-
curl -L -o __init__.py https://huggingface.co/spaces/RocketFarmStudios/CPS-API/resolve/e9ae3aeb6d4d2dbd87828c0d4514e2a4e7f71d8a/api/__init__.py
768 Bytes
| from fastapi import APIRouter | |
| import logging | |
| # Configure logging | |
| logging.basicConfig( | |
| level=logging.INFO, | |
| format='%(asctime)s - %(levelname)s - %(name)s - %(message)s' | |
| ) | |
| logger = logging.getLogger(__name__) | |
| def get_router(): | |
| router = APIRouter() | |
| # Import sub-modules from the routes directory | |
| from .routes.auth import auth | |
| from .routes.patients import patients | |
| from .routes.pdf import pdf | |
| # Include sub-routers, prioritizing patients to avoid conflicts | |
| router.include_router(patients, prefix="/ehr", tags=["patients"]) | |
| router.include_router(auth, prefix="/auth", tags=["auth"]) | |
| router.include_router(pdf, prefix="/ehr/patients", tags=["pdf"]) | |
| return router | |
| # Export the router | |
| api_router = get_router() |