MCPcopy Create free account
hub / github.com/OpenOSINT/OpenOSINT / create_app

Function create_app

openosint/web_server.py:692–939  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

690
691
692def create_app() -> FastAPI:
693 app = FastAPI(
694 title="OpenOSINT",
695 version=_VERSION,
696 docs_url=None,
697 redoc_url=None,
698 )
699
700 app.add_middleware(
701 CORSMiddleware,
702 allow_origins=["*"],
703 allow_methods=["*"],
704 allow_headers=["*"],
705 )
706
707 # ------------------------------------------------------------------
708 # GET /api/health
709 # ------------------------------------------------------------------
710
711 @app.get("/api/health")
712 async def health():
713 ai_backend, ollama_host, ollama_reachable = _get_ai_backend()
714 return {
715 "status": "ok",
716 "version": _VERSION,
717 "setup_complete": _is_setup_complete(),
718 "ai_backend": ai_backend,
719 "ollama_host": ollama_host,
720 "ollama_reachable": ollama_reachable,
721 }
722
723 # ------------------------------------------------------------------
724 # GET /api/tools
725 # ------------------------------------------------------------------
726
727 @app.get("/api/tools")
728 async def list_tools():
729 result = []
730 for meta in _TOOL_CATALOG:
731 available, reason = _check_available(meta)
732 result.append(
733 {
734 "name": meta["name"],
735 "description": meta["description"],
736 "input_label": meta["input_label"],
737 "input_placeholder": meta["input_placeholder"],
738 "category": meta["category"],
739 "icon": meta.get("icon", ""),
740 "available": available,
741 "unavailable_reason": reason,
742 }
743 )
744 return result
745
746 # ------------------------------------------------------------------
747 # POST /api/run/{tool_name}
748 # ------------------------------------------------------------------
749

Callers 2

serve_asyncFunction · 0.85
run_serverFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected