Skip to content

Commit

Permalink
Render API docs on root url
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaOndieki committed Jun 28, 2018
1 parent 87a0576 commit 667e6c8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ridemyway/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def create_app(config_name):
Usage: Factory function used to setup the application instance
:return: application instance
"""
app = Flask(__name__)
app = Flask(__name__, template_folder='../api_docs')
app.database = database
app.config.from_object(config[config_name])
app.config['BUNDLE_ERRORS'] = True
Expand All @@ -53,6 +53,11 @@ def check_if_token_in_blacklist(decrypted_token):
jti = decrypted_token['jti']
return jti in app.blacklist

@app.route('/')
def api_docs():
from flask import render_template
""" Route to the api docs"""
return render_template('api.html')
# Register Blueprint here
app.register_blueprint(v1, url_prefix="/api/v1")

Expand Down

0 comments on commit 667e6c8

Please sign in to comment.