Exemple #1
0
def create_app(config_object=None):
    """
    FLASK_ENV=development FLASK_APP=message_api.app flask run --port=5001
    """
    if config_object is None:
        config_object = Config
    app = Flask(__name__)
    app.config.from_object(config_object)
    app.register_blueprint(index.blueprint)
    app.register_blueprint(message.blueprint)
    handlers.register(app)
    return app
Exemple #2
0
def create_app(config_object=None):
    """
    PYTHONPATH=".;../" FLASK_ENV=development FLASK_APP=app flask run
    """
    if config_object is None:
        config_object = Config
    app = Flask(__name__)
    app.config.from_object(config_object)
    app.register_blueprint(index.blueprint)
    app.register_blueprint(message.blueprint)
    handlers.register(app)
    return app
Exemple #3
0
def create_app(config_object=None):
    """
    FLASK_ENV=development FLASK_APP=apis.subscriptions.app flask run
    """
    if config_object is None:
        config_object = Config
    app = Flask(__name__)
    app.config.from_object(config_object)
    app.register_blueprint(index.blueprint)
    app.register_blueprint(subscriptions.blueprint)
    error_handlers.register(app)
    return app
Exemple #4
0
def create_app(config_object=None):
    """
    FLASK_ENV=development FLASK_APP=apis.document.app flask run --port=5003
    """
    if config_object is None:
        config_object = Config
    app = Flask(__name__)
    app.request_class = BigMemoryRequest
    app.config.from_object(config_object)
    app.register_blueprint(index.blueprint)
    app.register_blueprint(documents.blueprint)
    handlers.register(app)
    return app
Exemple #5
0
def create_app(config_object=None):
    """
    FLASK_ENV=development FLASK_APP=message_api.app flask run --port=5001
    """
    if config_object is None:
        config_object = Config
    app = Flask(__name__)
    app.config.from_object(config_object)
    SENTRY_DSN = app.config.get("SENTRY_DSN")
    if SENTRY_DSN:
        import sentry_sdk
        from sentry_sdk.integrations.flask import FlaskIntegration
        from sentry_sdk.integrations.aws_lambda import AwsLambdaIntegration
        sentry_sdk.init(SENTRY_DSN, integrations=[FlaskIntegration(), AwsLambdaIntegration()])
    app.register_blueprint(index.blueprint)
    app.register_blueprint(message.blueprint)
    handlers.register(app)
    return app
Exemple #6
0
def create_app(config_object=None):
    """
    FLASK_ENV=development FLASK_APP=apis.document.app flask run --port=5003
    """
    if config_object is None:
        config_object = Config
    app = Flask(__name__)
    app.request_class = BigMemoryRequest
    app.config.from_object(config_object)
    SENTRY_DSN = app.config.get("SENTRY_DSN")
    if SENTRY_DSN:
        import sentry_sdk
        from sentry_sdk.integrations.flask import FlaskIntegration
        from sentry_sdk.integrations.aws_lambda import AwsLambdaIntegration
        sentry_sdk.init(SENTRY_DSN, integrations=[FlaskIntegration(), AwsLambdaIntegration()])
    app.register_blueprint(index.blueprint)
    app.register_blueprint(documents.blueprint)
    handlers.register(app)
    register_specs(app, spec, views=('document_post', 'document_fetch',))
    return app
Exemple #7
0
from flask import Flask, Response

from intergov.apis.common.errors import handlers
from intergov.loggers import logging  # NOQA

logger = logging.getLogger('dummy-test-helper')

app = Flask(__name__)
handlers.register(app)


@app.route('/response/<int:status_code>/<message>', methods=['GET', 'POST'])
def request_response(status_code, message):
    logger.info(
        f'Requested response with status: {status_code} and message:{message}')
    return Response(message, status=status_code)
Exemple #8
0
def app():
    app = Flask('common_api_utils_test_app')
    app.config.from_object(TestConfig)
    handlers.register(app)
    yield app