From 51636b1bea7f91740bb8009fabf820a8e7ad1de4 Mon Sep 17 00:00:00 2001 From: demo-bot Date: Sun, 9 Aug 2026 15:52:28 +0000 Subject: [PATCH] decomposer: generate deliverable files for Define the service contract and project architecture for the FastAPI endpoint monitoring service.; Implement the typed monitor CRUD API and concurrency-safe in-memory state according to the service design.; Implement secure on-demand endpoint checks with status updates, latency measurement, robust error handling, and redacted structured logs.; Add operational API endpoints and environment-driven runtime configuration to the monitoring service.; Create automated tests for the monitoring service.; Package the service with Docker and developer documentation.; Validate the complete project. --- src/endpoint_monitor/main.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/endpoint_monitor/main.py diff --git a/src/endpoint_monitor/main.py b/src/endpoint_monitor/main.py new file mode 100644 index 0000000..b9769c9 --- /dev/null +++ b/src/endpoint_monitor/main.py @@ -0,0 +1,20 @@ +from fastapi import FastAPI + +from .api import router +from .checker import EndpointChecker +from .config import Settings, get_settings +from .logging import configure_logging +from .store import MonitorStore + + +def create_app(settings: Settings | None = None) -> FastAPI: + settings = settings or get_settings() + configure_logging(settings.log_level) + app = FastAPI(title="Endpoint Monitor", version="1.0.0") + app.state.store = MonitorStore(settings.max_monitors) + app.state.checker = EndpointChecker(settings.request_timeout_seconds, settings.max_redirects) + app.include_router(router) + return app + + +app = create_app()