"""Run the OpenAPI demo server.

Usage:
    python -m examples.openapi_demo
    # or from the examples/openapi_demo directory:
    python __main__.py
"""

import sys
from pathlib import Path

# Ensure examples dir is importable when run directly
sys.path.insert(0, str(Path(__file__).parent))

from notes_api import NotesAPI

from genro_asgi import AsgiServer, OpenApiApplication

api = NotesAPI()
server = AsgiServer(server_dir=str(Path(__file__).parent))
app = OpenApiApplication(routing_class=api, docs="swagger")
server.mount("notes", app)
server.run()
