{% block imports %}
from litestar import Litestar, get
from litestar.config.cors import CORSConfig

from app.config import settings
from app.controllers.base import base_controller
{% endblock %}

{% block routes %}

@get("/health")
async def health() -> dict[str, str]:
    """Health check endpoint."""
    return {"status": "healthy"}
{% endblock %}

{% block plugin_setup %}
{# Plugins inject their setup code here #}
{% endblock %}

{% block app_config %}

app = Litestar(
    route_handlers=[health, base_controller],
    cors_config=CORSConfig(allow_origins=settings.ALLOWED_ORIGINS),
    debug=settings.DEBUG,
)
{% endblock %}
