Skip to content

Commit

Permalink
Merge pull request #27 from t4lz/ipv6-steal
Browse files Browse the repository at this point in the history
Change python test app to take the host and port to listen on from the env
  • Loading branch information
t4lz authored Dec 31, 2024
2 parents 8020b09 + ee9172a commit e7f9211
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions python/app.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
from flask import Flask

PORT = 80
import os

try:
HOST = os.environ['HOST']
except KeyError:
HOST = "0.0.0.0"

try:
PORT = os.environ['PORT']
except KeyError:
PORT = 80

print(f"Will listen on {HOST}:{PORT}")

app = Flask(__name__)

Expand All @@ -26,4 +38,4 @@ def delete():


if __name__ == "__main__":
app.run(host="0.0.0.0", port=PORT)
app.run(host=HOST, port=PORT)

0 comments on commit e7f9211

Please sign in to comment.