morphik-core/ee/routers/__init__.py
2025-05-04 00:23:18 -07:00

28 lines
890 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"""Enterprise-only FastAPI routers.
This sub-package bundles **all** additional HTTP API routes that are only
available in Morphik Enterprise Edition. Each module should expose an
``APIRouter`` instance called ``router`` so that it can be conveniently
mounted via :pyfunc:`ee.init_app`.
"""
from importlib import import_module
from typing import List
from fastapi import FastAPI
__all__: List[str] = []
def init_app(app: FastAPI) -> None:
"""Mount all enterprise routers onto the given *app* instance."""
# Discover routers lazily import sub-modules that register a global
# ``router`` attribute. Keep the list here explicit to avoid accidental
# exposure of unfinished modules.
for module_path in [
"ee.routers.cloud_uri",
]:
mod = import_module(module_path)
if hasattr(mod, "router"):
app.include_router(mod.router)