cic-internal-integration/apps/cic-eth/cic_eth/server/app.py

25 lines
643 B
Python
Raw Normal View History

2021-11-12 09:14:40 +01:00
#!/usr/bin/env python3
import cic_eth.cli
import connexion
from cic_eth.graphql.config import config
2021-11-16 14:37:16 +01:00
from cic_eth.server import encoder
2021-11-12 09:14:40 +01:00
celery_app = cic_eth.cli.CeleryApp.from_config(config)
celery_app.set_default()
2021-11-16 14:37:16 +01:00
def create_app(test_config=None):
app = connexion.App(__name__, specification_dir='./openapi/')
if test_config:
app.app.config.update(test_config)
2021-11-12 09:14:40 +01:00
app.app.json_encoder = encoder.JSONEncoder
2021-11-16 14:37:16 +01:00
app.add_api('server.yaml', arguments={
2021-11-17 13:21:23 +01:00
'title': 'Grassroots Economics'}, pythonic_params=True)
return app
2021-11-12 09:14:40 +01:00
if __name__ == '__main__':
2021-11-17 13:21:23 +01:00
app = create_app()
app.run(port=5000)