added blueprint for flask application setup common to all selene api's

pull/50/head
Chris Veilleux 2019-02-15 21:43:59 -06:00
parent 21ae4511b9
commit f5fb8b6dfe
2 changed files with 12 additions and 0 deletions

View File

@ -1,3 +1,4 @@
from .base_endpoint import APIError, SeleneEndpoint
from .base_config import get_base_config
from .blueprint import selene_api
from .response import SeleneResponse

View File

@ -0,0 +1,11 @@
from http import HTTPStatus
from flask import Blueprint
from schematics.exceptions import DataError
selene_api = Blueprint('selene_api', __name__)
@selene_api.app_errorhandler(DataError)
def handle_data_error(error):
return str(error.messages), HTTPStatus.BAD_REQUEST