Пример #1
0
def runserver(config_file):
    """Run in local machine."""
    configure_app(app, filename=config_file)
    app.run(
        host='0.0.0.0',
        port=8125,
        use_reloader=False,
    )
Пример #2
0
def build_app(config_file=DEFAULT_GLOBAL_CONFIG_FILE):
    configure_app(app, filename=config_file)
    return app
Пример #3
0
# init Flask app
app = create_app()
manager = Manager(app)


# run AgentStats API using Flask-Script
@manager.option('-c',
                '--config',
                dest='config_file',
                default=DEFAULT_GLOBAL_CONFIG_FILE)
def runserver(config_file):
    """Run in local machine."""
    configure_app(app, filename=config_file)
    app.run(
        host='0.0.0.0',
        port=8125,
        use_reloader=False,
    )


# run AgentStats API using Gunicorn
def build_app(config_file=DEFAULT_GLOBAL_CONFIG_FILE):
    configure_app(app, filename=config_file)
    return app


if __name__ == "__main__":
    # manager.run(default_command='runserver')
    configure_app(app)
    app.run(host='0.0.0.0', port='8125')
Пример #4
0
def run():
    uprint = partial(print, flush=True)
    port = int(os.environ.get('PORT', config.DEFAULT_RUN_PORT))
    app = configure_app()
    web.run_app(app, print=uprint, host=config.DEFAULT_RUN_HOST, port=port)