INNER CODE UNIT · Python
api_overview
marc-shade/world-intel-mcp · src/world_intel_mcp/dashboard/app.py:322
async def api_overview(request):
"""REST endpoint — full snapshot of all intelligence domains."""
data = await _fetch_overview()
return JSONResponse(data, headers={"Access-Control-Allow-Origin": "*"})
async def api_stream(request):
"""SSE endpoint — progressive: emits each source as it completes."""
async def event_generator():
while True:
try:
fetcher = _ensure_fetcher()
# Sources to fetch, grouped so fast ones arrive first
source_defs = {
"market_quotes": lambda: markets.fetch_market_quotes(fetcher),
"crypto_quotes": lambda: markets.fetch_crypto_quotes(fetcher),