Skip to content

Commit 74caee3

Browse files
committed
Allow giving the IP from the command line
1 parent ab53058 commit 74caee3

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

runserver.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@
1111
app.config['APPLICATION_ROOT'] = '/'
1212

1313
if __name__ == '__main__':
14+
if len(sys.argv) == 3:
15+
hostIP = port=sys.argv[2]
16+
else :
17+
hostIP = '0.0.0.0'
18+
1419
if len(sys.argv) == 2:
15-
app.run(debug=True, host='0.0.0.0', port=sys.argv[1])
20+
app.run(debug=True, host=hostIP, port=sys.argv[1])
1621
else:
17-
app.run(debug=True, host='0.0.0.0', port=8100)
22+
app.run(debug=True, host=hostIP, port=8100)

0 commit comments

Comments
 (0)