Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added server_args to AbstractApp #1173

Merged
merged 4 commits into from
Apr 25, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions connexion/apps/abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

class AbstractApp(metaclass=abc.ABCMeta):
def __init__(self, import_name, api_cls, port=None, specification_dir='',
host=None, server=None, arguments=None, auth_all_paths=False, debug=None,
host=None, server=None, server_args=None, arguments=None, auth_all_paths=False, debug=None,
resolver=None, options=None, skip_error_handlers=False):
"""
:param import_name: the name of the application package
Expand Down Expand Up @@ -45,8 +45,10 @@ def __init__(self, import_name, api_cls, port=None, specification_dir='',

self.options = ConnexionOptions(options)

self.app = self.create_app()
self.server = server
self.server_args = dict() if server_args is None else server_args
self.app = self.create_app()


# we get our application root path to avoid duplicating logic
self.root_path = self.get_root_path()
Expand Down
2 changes: 1 addition & 1 deletion connexion/apps/flask_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __init__(self, import_name, server='flask', **kwargs):
super(FlaskApp, self).__init__(import_name, FlaskApi, server=server, **kwargs)

def create_app(self):
app = flask.Flask(self.import_name)
app = flask.Flask(self.import_name, **self.server_args)
app.json_encoder = FlaskJSONEncoder
return app

Expand Down