Merge pull request #124 from pcamelo/magneticow-host

Make magneticow listening host available to the user
This commit is contained in:
Bora M. Alper 2017-07-21 21:44:18 +03:00 committed by GitHub
commit 91183f57d7

View File

@ -29,7 +29,7 @@ def main() -> int:
arguments = parse_args()
magneticow.app.arguments = arguments
http_server = gevent.wsgi.WSGIServer(("", arguments.port), magneticow.app)
http_server = gevent.wsgi.WSGIServer((arguments.host, arguments.port), magneticow.app)
magneticow.initialize_magneticod_db()
@ -67,6 +67,10 @@ def parse_args() -> argparse.Namespace:
allow_abbrev=False,
formatter_class=argparse.RawDescriptionHelpFormatter
)
parser.add_argument(
"--host", action="store", type=str, required=False, default="",
help="the host address magneticow web server should listen on"
)
parser.add_argument(
"--port", action="store", type=int, required=True,
help="the port number magneticow web server should listen on"