Skip to content

Commit

Permalink
Allow setting port by param
Browse files Browse the repository at this point in the history
  • Loading branch information
carlallen committed Jul 16, 2017
1 parent ca9575a commit a97c5f4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions run.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#!/usr/bin/env python

from modules import socketio, app
from modules import socketio, app, cbpi

socketio.run(app, host='0.0.0.0')
try:
port = int(cbpi.get_config_parameter('port', '5000'))
except ValueError:
port = 5000

socketio.run(app, host='0.0.0.0', port=port)

1 change: 1 addition & 0 deletions update/3_port_config.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
INSERT OR IGNORE INTO config VALUES ('port', 5000, 'number', 'Port to run server (requires restart)', NULL );

0 comments on commit a97c5f4

Please sign in to comment.