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 1
1
jsonschema
2
- python-dotenv
3
2
wslink
4
3
websocket-client
Original file line number Diff line number Diff line change 3
3
4
4
5
5
def default_config ():
6
- os .environ ["HOST " ] = "0.0.0.0 "
6
+ os .environ ["DEFAULT_HOST " ] = "localhost "
7
7
os .environ ["DEFAULT_PORT" ] = "1234"
8
8
9
9
Original file line number Diff line number Diff line change @@ -81,10 +81,6 @@ def initialize(self):
81
81
82
82
83
83
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 )
88
84
PYTHON_ENV = os .environ .get ("PYTHON_ENV" , default = "prod" ).strip ().lower ()
89
85
if PYTHON_ENV == "prod" :
90
86
prod_config ()
@@ -96,11 +92,14 @@ def run_server():
96
92
97
93
_Server .add_arguments (parser )
98
94
args = parser .parse_args ()
95
+
96
+ if "host" in args :
97
+ args .host = os .environ ["DEFAULT_HOST" ]
99
98
if not "port" in args or args .port == 8080 :
100
99
args .port = os .environ .get ("DEFAULT_PORT" )
101
100
if "data_folder_path" in args :
102
101
os .environ ["DATA_FOLDER_PATH" ] = args .data_folder_path
103
- args . host = os . environ . get ( "HOST" )
102
+
104
103
print (f"{ args = } " , flush = True )
105
104
_Server .configure (args )
106
105
server .start_webserver (options = args , protocol = _Server )
You can’t perform that action at this time.
0 commit comments