Created
January 28, 2018 19:08
-
-
Save Ryan-Gordon/d6e60edfe6942da7bf42918f5d73d441 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import connexion | |
from flask_injector import FlaskInjector | |
from connexion.resolver import RestyResolver | |
from providers.CouchProvider import CouchProvider | |
from injector import Binder | |
def configure(binder: Binder) -> Binder: | |
binder.bind( | |
CouchProvider | |
) | |
if __name__ == '__main__': | |
app = connexion.App(__name__, specification_dir='swagger/') # Provide the app and the directory of the docs | |
app.add_api('couch-service-docs.yaml', resolver=RestyResolver('api')) | |
FlaskInjector(app=app.app, modules=[configure]) | |
app.run(port=int(os.environ.get('PORT', 2020))) # os.environ is handy if you intend to launch on heroku |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment