22 lines
604 B
Python
22 lines
604 B
Python
#!/usr/bin/env python3
|
|
import logging
|
|
|
|
import connexion
|
|
|
|
from openapi_server import encoder
|
|
from pymongo import MongoClient
|
|
|
|
client = MongoClient(host='mongodb://host.docker.internal:27017/')
|
|
db = client["MainDB"]
|
|
collection = db['patch_notes']
|
|
|
|
app = connexion.App(__name__, specification_dir='./openapi/')
|
|
app.app.logger.setLevel(logging.DEBUG)
|
|
app.app.json_encoder = encoder.JSONEncoder
|
|
app.add_api('openapi.yaml',
|
|
base_path='/api',
|
|
arguments={'title': 'announcementService'},
|
|
pythonic_params=True)
|
|
|
|
if __name__ == '__main__':
|
|
app.run(port=8080, host='0.0.0.0') |