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:
parent
3c818e5b46
commit
63e9266d28
1 changed files with 6 additions and 1 deletions
|
|
@ -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))
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue