Skip to content

Commit

Permalink
fix sample code
Browse files Browse the repository at this point in the history
  • Loading branch information
Ballhausen committed Dec 7, 2023
1 parent 1156f8f commit 2f1273a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@

import sys
import connexion
import waitress

from flask import current_app

from federatedsecure.server.bus import Bus
from encoder import JSONEncoder


def main():
Expand All @@ -27,8 +25,7 @@ def main():

bus = Bus()

app = connexion.App(__name__, specification_dir='openapi/')
app.app.json_encoder = JSONEncoder
app = connexion.FlaskApp(__name__, specification_dir='openapi/')
app.add_api('openapi.yaml',
arguments={'title': 'Federated Secure Computing'},
pythonic_params=True)
Expand All @@ -43,7 +40,7 @@ def after_request(response):
response.headers.add('Access-Control-Allow-Methods', 'GET,PUT,POST,PATCH,DELETE')
return response

waitress.serve(app, host="0.0.0.0", port=port)
app.run(port=port)


if __name__ == '__main__':
Expand Down

0 comments on commit 2f1273a

Please sign in to comment.