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.
Some checks failed
ci / validate (push) Has been cancelled
Some checks failed
ci / validate (push) Has been cancelled
This commit is contained in:
20
src/endpoint_monitor/main.py
Normal file
20
src/endpoint_monitor/main.py
Normal file
@@ -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()
|
||||
Reference in New Issue
Block a user