-
Notifications
You must be signed in to change notification settings - Fork 0
/
api_run.py
32 lines (25 loc) · 1 KB
/
api_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
if __name__ == '__main__':
from gevent import monkey
monkey.patch_all()
import argparse
from api import app
from gevent.pywsgi import WSGIServer
description = '''EaseMonitor Restful API design for data search'''
parser = argparse.ArgumentParser(description=description)
parser.add_argument('-a', '--host',
required=True,
dest='host',
type=str,
action='store',
help='define Monitor API server host listening')
parser.add_argument('-p', '--port',
required=True,
dest='port',
type=int,
action='store',
help='define Monitor API server host listening')
args = parser.parse_args()
server = WSGIServer((args.host, args.port), app)
# server = WSGIServer(('0.0.0.0', 11111), app)
server.serve_forever()
# app.run('0.0.0.0', 11111)