5
0
mirror of https://github.com/cwinfo/yggdrasil-map synced 2024-11-21 19:20:28 +00:00

take host and port as arguments

This commit is contained in:
Arceliar 2019-01-14 22:10:21 -06:00
parent 9c62cf6404
commit 9925488716

View File

@ -1,6 +1,11 @@
from flask import Flask, render_template, request
from graphData import insert_graph_data
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--host", type=str, help="host to listen on (default 'localhost')", default="localhost")
parser.add_argument("--port", type=int, help="port to listen on (default '3000')", default=3000)
app = Flask(__name__)
app.config.from_pyfile('web_config.cfg')
@ -47,4 +52,5 @@ def add_header(response):
return response
if __name__ == '__main__':
app.run(host='localhost', port=3000)
args = parser.parse_args()
app.run(host=args.host, port=args.port)