def create_app(self): app = create_api_compat_app(config_path=os.path.join( os.path.dirname(os.path.realpath(__file__)), '..', 'test_config.py' )) app.config['TESTING'] = True return app
def create_app(self): app = create_api_compat_app(config_path=os.path.join( os.path.dirname(os.path.realpath(__file__)), '..', 'test_config.py' )) app.config['TESTING'] = True return app
def run_api_compat_server(host, port, debug=False): application = webserver.create_api_compat_app() run_simple(hostname=host, port=port, application=application, use_debugger=debug, use_reloader=debug, processes=5)
def run_api_compat_server(host, port, debug=False): application = webserver.create_api_compat_app() run_simple( hostname=host, port=port, application=application, use_debugger=debug, use_reloader=debug, processes=5 )
#!/usr/bin/env python from listenbrainz.webserver import create_api_compat_app import argparse from werkzeug.contrib.profiler import ProfilerMiddleware application = create_api_compat_app() if __name__ == "__main__": parser = argparse.ArgumentParser( description="ListenBrainz Server Compatible API") parser.add_argument("-d", "--debug", action="store_true", help="Turn on debugging mode to see stack traces on " "the error pages. This overrides 'DEBUG' value " "in config file.") parser.add_argument( "-t", "--host", default="0.0.0.0", type=str, help="Which interfaces to listen on. Default: 0.0.0.0.") parser.add_argument("-p", "--port", default="8080", type=int, help="Which port to listen on. Default: 8080.") args = parser.parse_args() application.run(debug=True if args.debug else None, host=args.host, port=args.port)
def create_app(self): app = create_api_compat_app() app.config['TESTING'] = True return app