import os

import uvicorn

from zangramru.settings import settings


def main() -> None:
    """Entrypoint of the application."""
    os.environ["PICCOLO_CONF"] = "zangramru.piccolo_conf"
    uvicorn.run(
        "zangramru.web.application:get_app",
        workers=settings.workers_count,
        host=settings.server_host,
        port=settings.server_port,
        reload=settings.reload,
        log_level=settings.log_level.value.lower(),
        access_log=True,
        factory=True,
    )


if __name__ == "__main__":
    main()
