forked from jeff1evesque/machine-learning
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
32 lines (26 loc) · 740 Bytes
/
app.py
File metadata and controls
32 lines (26 loc) · 740 Bytes
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
'''@app
This file is the acting web server.
@host, tells the OS (guest VM) to accept connections from all public IP
addresses.
Note: both the handler, and logger has levels. If the level of the logger is
higher than that of the handler, no messages will be handled by the
corresponding handler.
'''
import sys
import pytest
from factory import create_app
# run unit test
if len(sys.argv) > 1:
if sys.argv[1] == 'test':
pytest.main(['test/live_server'])
elif sys.argv[1] == 'run':
args = {
'prefix': 'test',
'settings': ''
}
app = create_app(args)
app.run(host='0.0.0.0')
# run application
else:
app = create_app()
app.run(host='0.0.0.0')