forked from aichaos/rivescript-playground
-
Notifications
You must be signed in to change notification settings - Fork 1
/
run.py
32 lines (28 loc) · 820 Bytes
/
run.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
# RiveScript Playground
#
# This code is released under the GNU General Public License, version 2.
# See the LICENSE file for more information.
from playground.app import create_app
import argparse
def main(opts):
flask_options = dict(
host='0.0.0.0',
debug=not opts.prod,
port=opts.port,
threaded=True,
)
app = create_app()
app.run(**flask_options)
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="RiveScript Playground.")
parser.add_argument("--port", "-p",
help="The port number to listen on.",
type=int,
default=2006,
)
parser.add_argument("--prod",
help="Run the app in production mode (debugging disabled).",
action="store_true",
)
opts = parser.parse_args()
main(opts)