def make_app(): swagger.docs(base_url=CONF.ui_url, static_path=CONF.ui_static_path) return swagger.Application( url_mappings.mappings, debug=CONF.api_debug, auth=CONF.api_token_check, cookie_secret='opnfv-testapi', )
def make_app(): swagger.docs(base_url=CONF.swagger_base_url, static_path=CONF.static_path) return swagger.Application( url_mappings.mappings, debug=CONF.api_debug, auth=CONF.api_authenticate, cookie_secret='opnfv-testapi', )
def make_app(): swagger.docs(base_url=CONF.swagger_base_url) return swagger.Application(url_mappings.mappings, db=get_db(), debug=CONF.api_debug_on, auth=CONF.api_authenticate_on)
from opnfv_testapi.router import url_mappings # optionally get config file from command line parser = argparse.ArgumentParser() parser.add_argument("-c", "--config-file", dest='config_file', help="Config file location") args = parser.parse_args() CONF = APIConfig().parse(args.config_file) # connecting to MongoDB server, and choosing database client = motor.MotorClient(CONF.mongo_url) db = client[CONF.mongo_dbname] swagger.docs(base_url=CONF.swagger_base_url) def make_app(): return swagger.Application( url_mappings.mappings, db=db, debug=CONF.api_debug_on, ) def main(): application = make_app() application.listen(CONF.api_port) tornado.ioloop.IOLoop.current().start()