コード例 #1
0
ファイル: api.py プロジェクト: LefterisJP/rotkehlchen
    def __init__(self, rest_api) -> None:
        flask_app = Flask(__name__)
        blueprint = create_blueprint()

        restapi_setup_urls(
            blueprint,
            rest_api,
            URLS,
        )

        self.rest_api = rest_api
        self.flask_app = flask_app
        self.blueprint = blueprint

        self.wsgiserver: Optional[WSGIServer] = None
        self.flask_app.register_blueprint(self.blueprint)

        self.flask_app.errorhandler(HTTPStatus.NOT_FOUND)(endpoint_not_found)
コード例 #2
0
ファイル: api.py プロジェクト: BlockchainDARG/rotkehlchen
    def __init__(self, rest_api):
        flask_app = Flask(__name__)
        blueprint = create_blueprint()
        flask_api_context = Api(blueprint)

        restapi_setup_urls(
            flask_api_context,
            rest_api,
            URLS,
        )

        self.rest_api = rest_api
        self.flask_app = flask_app
        self.blueprint = blueprint
        self.flask_api_context = flask_api_context

        self.wsgiserver = None
        self.flask_app.register_blueprint(self.blueprint)

        self.flask_app.errorhandler(HTTPStatus.NOT_FOUND)(endpoint_not_found)