Skip to content

Exporter Server (based on Starlette)

server

Classes

Server

Server(doctor_repo: DoctorRepository, exporter: Exporter)

Bases: LoggingMixin

Source code in audex/lib/server/__init__.py
def __init__(self, doctor_repo: DoctorRepository, exporter: Exporter):
    super().__init__()
    self.doctor_repo = doctor_repo
    self.exporter = exporter

    # Get template directory (relative to this file)
    template_dir = importlib.resources.files("audex.lib.server").joinpath("templates")
    self.templates = Jinja2Templates(directory=str(template_dir))

    # Create handlers
    self.handlers = RequestHandlers(
        templates=self.templates,
        doctor_repo=doctor_repo,
        exporter=exporter,
    )

    # Create app
    self.app = self._create_app()
    self.server: t.Any = None

options: show_root_heading: true show_source: true heading_level: 2 members_order: source show_signature_annotations: true separate_signature: true