Esempio n. 1
0
def create_app(config_name, config_overrides=None):
    application = Flask(__name__)

    application.config['NOTIFY_API_ENVIRONMENT'] = config_name
    application.config.from_object(configs[config_name])

    db.init_app(application)
    ma.init_app(application)
    init_app(application, config_overrides)
    logging.init_app(application)
    notify_alpha_client.init_app(application)

    from app.service.rest import service as service_blueprint
    from app.user.rest import user as user_blueprint
    from app.template.rest import template as template_blueprint
    from app.status.healthcheck import status as status_blueprint
    from app.job.rest import job as job_blueprint
    from app.notifications.rest import notifications as notifications_blueprint

    application.register_blueprint(service_blueprint, url_prefix='/service')
    application.register_blueprint(user_blueprint, url_prefix='/user')
    application.register_blueprint(template_blueprint, url_prefix="/template")
    application.register_blueprint(status_blueprint, url_prefix='/status')
    application.register_blueprint(notifications_blueprint, url_prefix='/notifications')
    application.register_blueprint(job_blueprint)

    return application
Esempio n. 2
0
def create_app(config_name, config_overrides=None):
    application = Flask(__name__)

    application.config['NOTIFY_API_ENVIRONMENT'] = config_name
    application.config.from_object(configs[config_name])

    db.init_app(application)
    ma.init_app(application)
    init_app(application, config_overrides)
    logging.init_app(application)
    notify_alpha_client.init_app(application)

    from app.service.rest import service as service_blueprint
    from app.user.rest import user as user_blueprint
    from app.template.rest import template as template_blueprint
    from app.status.healthcheck import status as status_blueprint
    from app.job.rest import job as job_blueprint
    from app.notifications.rest import notifications as notifications_blueprint

    application.register_blueprint(service_blueprint, url_prefix='/service')
    application.register_blueprint(user_blueprint, url_prefix='/user')
    application.register_blueprint(template_blueprint, url_prefix="/template")
    application.register_blueprint(status_blueprint, url_prefix='/status')
    application.register_blueprint(notifications_blueprint,
                                   url_prefix='/notifications')
    application.register_blueprint(job_blueprint)

    return application
Esempio n. 3
0
def create_app(config_name):
    application = Flask(__name__)

    application.config['NOTIFY_API_ENVIRONMENT'] = config_name
    application.config.from_object(configs[config_name])

    init_app(application)

    logging.init_app(application)

    from .main import main as main_blueprint
    application.register_blueprint(main_blueprint)

    from .status import status as status_blueprint
    application.register_blueprint(status_blueprint)

    return application
Esempio n. 4
0
def create_app():
    application = Flask(__name__)

    application.config.from_object(os.environ['NOTIFY_DELIVERY_ENVIRONMENT'])
    logging.init_app(application)

    from notifications_delivery.app.main.views import main as main_blueprint
    application.register_blueprint(main_blueprint)

    from notifications_delivery.app.status.rest import status as status_blueprint
    application.register_blueprint(status_blueprint)

    register_error_handlers(application)

    api_client.init_app(application)

    init_scheduler(application)

    return application