Fix API prefix.

This commit is contained in:
Alexis Lahouze 2016-06-16 23:22:20 +02:00
parent 17709f8f47
commit c5a73623cf

View File

@ -23,6 +23,7 @@ from flask_sqlalchemy import SQLAlchemy
# The app
app = Flask(__name__, static_folder=None, template_folder=None)
# Configure it from config.cfg.
app.config.from_pyfile('config.cfg')
app.config['SQLALCHEMY_ECHO'] = app.debug
@ -40,13 +41,8 @@ authorizations = {
}
}
api = Api(app, doc='/doc/', authorizations=authorizations)
api = Api(app, authorizations=authorizations, prefix='/api')
CORS(app)
# Load all views.
from .views import * # flake8: noqa
# Redirect / to API documentation.
@app.route('/')
def index():
return redirect(url_for('doc'))