-
Notifications
You must be signed in to change notification settings - Fork 86
/
app.py
32 lines (26 loc) · 734 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
'''@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(['-x', 'test'])
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')