Skip to content

Commit 3ff4710

Browse files
Merge pull request #25 from Geode-solutions/fix/host
Fix/host
2 parents 1667c3f + a8d54a8 commit 3ff4710

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

requirements.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
jsonschema
2-
python-dotenv
32
wslink
43
websocket-client

src/opengeodeweb_viewer/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44

55
def default_config():
6-
os.environ["HOST"] = "0.0.0.0"
6+
os.environ["DEFAULT_HOST"] = "localhost"
77
os.environ["DEFAULT_PORT"] = "1234"
88

99

src/opengeodeweb_viewer/vtkw_server.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,6 @@ def initialize(self):
8181

8282

8383
def run_server():
84-
basedir = os.path.abspath(os.path.dirname(__file__))
85-
dot_env_path = os.path.join(basedir, "../../.env")
86-
if os.path.isfile(dot_env_path):
87-
dotenv.load_dotenv(dot_env_path)
8884
PYTHON_ENV = os.environ.get("PYTHON_ENV", default="prod").strip().lower()
8985
if PYTHON_ENV == "prod":
9086
prod_config()
@@ -96,11 +92,14 @@ def run_server():
9692

9793
_Server.add_arguments(parser)
9894
args = parser.parse_args()
95+
96+
if "host" in args:
97+
args.host = os.environ["DEFAULT_HOST"]
9998
if not "port" in args or args.port == 8080:
10099
args.port = os.environ.get("DEFAULT_PORT")
101100
if "data_folder_path" in args:
102101
os.environ["DATA_FOLDER_PATH"] = args.data_folder_path
103-
args.host = os.environ.get("HOST")
102+
104103
print(f"{args=}", flush=True)
105104
_Server.configure(args)
106105
server.start_webserver(options=args, protocol=_Server)

0 commit comments

Comments
 (0)