From 63e9266d28f84a9fcd7c998f14c3d0ac6457176e Mon Sep 17 00:00:00 2001 From: Kevin Cojean Date: Thu, 19 Jun 2025 16:54:38 +0200 Subject: [PATCH] Allow configuration of Host and Port for FastAPI via environment variables (#997) Allow configuration of Host and Port for FastAPI via environment variables ## Description Starting the FastAPI server using environment variables for host and port parameters. ## DCO Affirmation I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin. --------- Co-authored-by: kevco Co-authored-by: Vasilije <8619304+Vasilije1990@users.noreply.github.com> --- cognee/api/client.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cognee/api/client.py b/cognee/api/client.py index 027b31c55..5a3aad8db 100644 --- a/cognee/api/client.py +++ b/cognee/api/client.py @@ -196,4 +196,9 @@ def start_api_server(host: str = "0.0.0.0", port: int = 8000): if __name__ == "__main__": logger = setup_logging() - start_api_server() + + start_api_server( + host=os.getenv("HTTP_API_HOST", "0.0.0.0"), + port=int(os.getenv("HTTP_API_PORT", 8000)) + ) +