示例#1
0
def create_app(*, debug=False, threads=1, bigchaindb_factory=None):
    """Return an instance of the Flask application.

    Args:
        debug (bool): a flag to activate the debug mode for the app
            (default: False).
        threads (int): number of threads to use
    Return:
        an instance of the Flask application.
    """

    if not bigchaindb_factory:
        bigchaindb_factory = Bigchain

    app = Flask(__name__)
    app.wsgi_app = StripContentTypeMiddleware(app.wsgi_app)

    CORS(app)

    app.debug = debug

    app.config['bigchain_pool'] = utils.pool(bigchaindb_factory, size=threads)

    add_routes(app)

    return app
示例#2
0
def create_app(*, debug=False, threads=4):
    """Return an instance of the Flask application.

    Args:
        debug (bool): a flag to activate the debug mode for the app
            (default: False).
        threads (int): number of threads to use
    Return:
        an instance of the Flask application.
    """

    app = Flask(__name__)

    CORS(app,
         headers=(
             'x-requested-with',
             'content-type',
             'accept',
             'origin',
             'authorization',
             'x-csrftoken',
             'withcredentials',
             'cache-control',
             'cookie',
             'session-id',
         ),
         supports_credentials=True)

    app.debug = debug

    app.config['bigchain_pool'] = utils.pool(Bigchain, size=threads)

    add_routes(app)

    return app
示例#3
0
def create_app(*, debug=False, threads=1, bigchaindb_factory=None):
    """Return an instance of the Flask application.

    Args:
        debug (bool): a flag to activate the debug mode for the app
            (default: False).
        threads (int): number of threads to use
    Return:
        an instance of the Flask application.
    """

    if not bigchaindb_factory:
        bigchaindb_factory = BigchainDB

    app = Flask(__name__)
    app.wsgi_app = StripContentTypeMiddleware(app.wsgi_app)

    CORS(app)

    app.debug = debug

    app.config['bigchain_pool'] = utils.pool(bigchaindb_factory, size=threads)

    add_routes(app)

    return app
示例#4
0
def create_app(*, debug=False, threads=4):
    """Return an instance of the Flask application.

    Args:
        debug (bool): a flag to activate the debug mode for the app
            (default: False).
        threads (int): number of threads to use
    Return:
        an instance of the Flask application.
    """

    app = Flask(__name__)

    CORS(app,
         headers=(
             'x-requested-with',
             'content-type',
             'accept',
             'origin',
             'authorization',
             'x-csrftoken',
             'withcredentials',
             'cache-control',
             'cookie',
             'session-id',
         ),
         supports_credentials=True)

    app.debug = debug

    app.config['bigchain_pool'] = utils.pool(Bigchain, size=threads)

    add_routes(app)

    return app
示例#5
0
def create_app(*, debug=False, threads=4):
    """Return an instance of the Flask application.

    Args:
        debug (bool): a flag to activate the debug mode for the app
            (default: False).
        threads (int): number of threads to use
    Return:
        an instance of the Flask application.
    """

    app = Flask(__name__)

    app.debug = debug

    app.config['bigchain_pool'] = utils.pool(Bigchain, size=threads)

    add_routes(app)

    return app