File tree Expand file tree Collapse file tree 3 files changed +5
-7
lines changed Expand file tree Collapse file tree 3 files changed +5
-7
lines changed Original file line number Diff line number Diff line change 11jsonschema
2- python-dotenv
32wslink
43websocket-client
Original file line number Diff line number Diff line change 33
44
55def default_config ():
6- os .environ ["HOST " ] = "0.0.0.0 "
6+ os .environ ["DEFAULT_HOST " ] = "localhost "
77 os .environ ["DEFAULT_PORT" ] = "1234"
88
99
Original file line number Diff line number Diff line change @@ -81,10 +81,6 @@ def initialize(self):
8181
8282
8383def 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 )
You can’t perform that action at this time.
0 commit comments