This commit is contained in:
Martin
2016-06-30 17:31:58 +02:00
parent 032b417e1d
commit 77634ae303
15 changed files with 41 additions and 23 deletions
+4 -2
View File
@@ -7,6 +7,7 @@ from api.validators import ValidationError
db = SQLAlchemy()
esales = Esales()
def create_app(config_name='config'):
app = Flask(__name__)
app.config.from_object(config_name)
@@ -17,7 +18,8 @@ def create_app(config_name='config'):
# register errors handlers
@app.errorhandler(404)
def on_404(error):
response = jsonify({'status': 404, 'message': 'The requested resource was not found'})
response = jsonify(
{'status': 404, 'message': 'The requested resource was not found'})
response.status_code = 404
return response
@@ -36,4 +38,4 @@ def create_app(config_name='config'):
# authentication
app.before_request(check_api_key)
return app
return app