From c5a73623cf3944b104fc84e42646418414768a94 Mon Sep 17 00:00:00 2001 From: Alexis Lahouze Date: Thu, 16 Jun 2016 23:22:20 +0200 Subject: [PATCH] Fix API prefix. --- accountant/__init__.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/accountant/__init__.py b/accountant/__init__.py index 94b0363..536645c 100644 --- a/accountant/__init__.py +++ b/accountant/__init__.py @@ -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'))