forked from MarionetteSHF/DBp1part3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
35 lines (24 loc) · 770 Bytes
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from DBp1part3 import create_app
app = create_app()
#
# if __name__ == '__main__':
# app.run(debug=True, port=8111)
if __name__ == "__main__":
import click
@click.command()
@click.option('--debug', is_flag=True)
@click.option('--threaded', is_flag=True)
@click.argument('HOST', default='0.0.0.0')
@click.argument('PORT', default=8111, type=int)
def run(debug, threaded, host, port):
"""
This function handles command line parameters.
Run the server using
python server.py
Show the help text using
python server.py --help
"""
HOST, PORT = host, port
# app.run(debug=True,host=HOST, port=PORT, debug=debug, threaded=threaded)
app.run(debug=True, host=HOST, port=PORT, threaded=threaded)
run()