Allow configuration of Host and Port for FastAPI via environment variables (#997)

Allow configuration of Host and Port for FastAPI via environment
variables

<!-- .github/pull_request_template.md -->

## 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 <kevin.cojean@agysoft.fr>
Co-authored-by: Vasilije <8619304+Vasilije1990@users.noreply.github.com>
This commit is contained in:
Kevin Cojean 2025-06-19 16:54:38 +02:00 committed by GitHub
parent 3c818e5b46
commit 63e9266d28
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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))
)