aswi2021jmsd-gitlab/swagger_server/__main__.py @ a0d4dda1
1 |
#!/usr/bin/env python3
|
---|---|
2 |
import logging |
3 |
|
4 |
import connexion |
5 |
|
6 |
from swagger_server import encoder |
7 |
|
8 |
|
9 |
app = connexion.App(__name__, specification_dir='./swagger/', debug=False) |
10 |
PORT = 8080 |
11 |
|
12 |
|
13 |
def setup(a): |
14 |
a.app.json_encoder = encoder.JSONEncoder |
15 |
a.add_api('swagger.yaml', arguments={'title': 'X.509 certificate management'}, base_path="/", pythonic_params=True) |
16 |
# a.run(port=PORT)
|
17 |
|
18 |
|
19 |
if __name__ == '__main__': |
20 |
setup(app) |
21 |
app.run(PORT) |