-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
32 lines (30 loc) · 775 Bytes
/
Copy pathmain.py
File metadata and controls
32 lines (30 loc) · 775 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
import uvicorn
LOG = 'debug'
if __name__ == '__main__':
try:
if LOG == 'debug':
uvicorn.run(
"api:app",
host='0.0.0.0',
port=8080,
workers=1,
log_level='info',
reload=True,
)
else:
uvicorn.run(
"api:app",
host='0.0.0.0',
port=8080,
workers=5,
log_level='warning',
reload=False,
)
except KeyboardInterrupt:
print('\nExiting\n')
except Exception as errormain:
print('Failed to Start API')
print('='*100)
print(str(errormain))
print('='*100)
print('Exiting\n')