-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrunserver.py
32 lines (25 loc) · 901 Bytes
/
runserver.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
from ccas import app
import optparse
def flaskrun(default_host="localhost",
default_port="5000"):
parser = optparse.OptionParser()
parser.add_option("-H", "--host",
help="Hostname/IP of CCAS " + \
"[default %s]" % default_host,
default=default_host)
parser.add_option("-P", "--port",
help="Port for the CCAS " + \
"[default %s]" % default_port,
default=default_port)
parser.add_option("-d", "--debug",
action="store_true", dest="debug",
help=optparse.SUPPRESS_HELP)
options, _ = parser.parse_args()
app.run(
debug=options.debug,
host=options.host,
port=int(options.port),
threaded=True
)
if __name__ == '__main__':
flaskrun()