24 lines
808 B
Python
24 lines
808 B
Python
#!/usr/bin/python3
|
|
from flaschengeist.app import create_app, install_all
|
|
import bjoern
|
|
import argparse
|
|
|
|
|
|
if __name__ == '__main__':
|
|
parser = argparse.ArgumentParser()
|
|
parser.add_argument("--host", help="set hostname to listen on", default="127.0.0.1")
|
|
parser.add_argument("--port", help="set port to listen on", type=int, default=5000)
|
|
parser.add_argument("--debug", help="run in debug mode", action="store_true")
|
|
parser.add_argument("--install", help="installer", action="store_true")
|
|
args = parser.parse_args()
|
|
|
|
app = create_app()
|
|
if args.install:
|
|
with app.app_context():
|
|
install_all()
|
|
else:
|
|
if args.debug:
|
|
app.run(args.host, args.port, debug=True)
|
|
else:
|
|
bjoern.run(app, args.host, args.port, reuse_port=True)
|