diff --git a/app/main.py b/app/main.py index f96d7ba..66c2619 100644 --- a/app/main.py +++ b/app/main.py @@ -17,6 +17,7 @@ class Application: self.app = FastAPI( lifespan = self._lifespan_event ) self._set_image_sizes() self._setup_static_files() + self._setup_health_route() self._include_routers() self._include_middelware() @@ -53,6 +54,11 @@ class Application: self.app.include_router(route_to_web.router) self.app.include_router( image_service.router ) + def _setup_health_route(self): + @self.app.get("/health", tags=["Health"]) + async def health_check(): + return {"status": "ok"} + def _include_middelware(self): self.app.add_middleware( GZipMiddleware, minimum_size = 500 ) @@ -69,10 +75,6 @@ class Application: """Return the FastAPI app instance.""" return self.app - @app.get("/health") - async def health(self): - return {"status": "healthy"} - application = Application() app = application.get_app()