Merge pull request #18 from SHSauler/master

server hostname and port into config file
pull/20/head
mokaddem 2017-12-12 16:52:37 +01:00 committed by GitHub
commit 5050a6927f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -1,3 +1,7 @@
[Server]
host = localhost
port = 8001
[Dashboard] [Dashboard]
#hours #hours
graph_log_refresh_rate = 1 graph_log_refresh_rate = 1

View File

@ -19,6 +19,9 @@ configfile = os.path.join(os.environ['DASH_CONFIG'], 'config.cfg')
cfg = configparser.ConfigParser() cfg = configparser.ConfigParser()
cfg.read(configfile) cfg.read(configfile)
server_host = cfg.get("Server", "host")
server_port = cfg.getint("Server", "port")
app = Flask(__name__) app = Flask(__name__)
redis_server_log = redis.StrictRedis( redis_server_log = redis.StrictRedis(
@ -541,4 +544,4 @@ def getTypeaheadData():
return jsonify(data) return jsonify(data)
if __name__ == '__main__': if __name__ == '__main__':
app.run(host='localhost', port=8001, threaded=True) app.run(host=server_host, port=server_port, threaded=True)