Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add support for custom host/port when debugging

  • Loading branch information...
commit 6400df76fbb32e9510b533aae7f73806e8971a41 1 parent d77a02e
Artem Nezvigin authored
Showing with 4 additions and 2 deletions.
  1. +3 −1 bin/run-server.py
  2. +1 −1  src/faceoff/config.py
4 bin/run-server.py
View
@@ -16,6 +16,8 @@
from argparse import ArgumentParser
parser = ArgumentParser(usage='%(prog)s [options]', argument_default='')
+parser.add_argument('--host', metavar='<string>', dest='FACEOFF_HOST', default='faceoff.dev')
+parser.add_argument('--port', metavar='<string>', dest='FACEOFF_PORT', default='5000')
parser.add_argument('--config', metavar='<string>', dest='FACEOFF_CONFIG')
parser.add_argument('--debug', action='store_const', const='1', dest='FACEOFF_DEBUG')
parser.add_argument('--db-path', metavar='<string>', dest='FACEOFF_DB_PATH')
@@ -28,4 +30,4 @@
os.environ.update(vars(args))
from faceoff import app
-app.run(threaded=True)
+app.run(args.FACEOFF_HOST, int(args.FACEOFF_PORT), threaded=True)
2  src/faceoff/config.py
View
@@ -10,7 +10,7 @@
# flask
LOGGER_NAME = 'faceoff'
DEBUG = os.getenv('FACEOFF_DEBUG') == '1'
-SERVER_NAME = 'faceoff.dev:5000'
+SERVER_NAME = os.getenv('FACEOFF_HOST') + ':' + os.getenv('FACEOFF_PORT')
SECRET_KEY = '89a1100b5a62059021260a75738e6e61' if DEBUG else os.urandom(24)
PERMANENT_SESSION_LIFETIME = 60*60*24*365
Please sign in to comment.
Something went wrong with that request. Please try again.