import uvicorn

from api_initializer.config import api_config
from api_initializer.create_app import create_app

# from prometheus_fastapi_instrumentator import Instrumentator

app = create_app()  # Create FastAPI application
# Instrumentator().instrument(app=app).expose(app=app)          # Setup Prometheus metrics


if __name__ == "__main__":
    uvicorn_config = uvicorn.Config(**api_config.app_as_dict, workers=1)    # Run the application with Uvicorn Server
    uvicorn.Server(uvicorn_config).run()
