

def startServer(level='info', server='paste', host='0.0.0.0', port='8080', base='', cors=False, tls=False, certpath='/etc/pki/tls/certs/localhost.crt', keypath='/etc/pki/tls/certs/localhost.key', pempath='/etc/pki/tls/certs/localhost.pem', devel=False, coffee=False, opts=None, **kwas):
    "\n    Starts up and runs web application server and salt api server\n    Parameters:\n        level = logging level string, default is 'info'\n        server = server name string, default is 'paste'\n        host = host address or domain name string, default is '0.0.0.0'\n        port = port number string, default is '8080'\n        base = url path base prefix string, default is ''\n        cors = enable CORS if truthy, default is False\n        tls = use tls/ssl if Truthy, default is False\n        certpath = pathname string to ssl certificate file, default is\n                   '/etc/pki/tls/certs/localhost.crt'\n        keypath = pathname string to ssl private key file, default is\n                   '/etc/pki/tls/certs/localhost.key'\n        pempath = pathname string to ssl pem file with both cert and private key,\n                   default is '/etc/pki/tls/certs/localhost.pem'\n        devel = generate main.html if truthy on each request in support of development\n                   default is False\n        coffee = generate main.html to load and compile coffeescript if truthy when\n                   devel is true. Default is False\n        kwas = additional keyword arguments dict that are passed as server options\n    Does not return.\n    "
    global gevented, gevent, bottle
    logger.setLevel(aiding.LOGGING_LEVELS[level])
    gevented = False
    if (server in ['gevent']):
        try:
            import gevent
            from gevent import monkey
            monkey.patch_all()
            gevented = True
        except ImportError as ex:
            server = 'paste'
    tlsOptions = {
        
    }
    tlsOptions['paste'] = {
        'ssl_pem': pempath,
    }
    tlsOptions['gevent'] = {
        'keyfile': keypath,
        'certfile': certpath,
    }
    tlsOptions['cherrypy'] = {
        'keyfile': keypath,
        'certfile': certpath,
    }
    options = dict(**kwas)
    if (tls and (server in tlsOptions)):
        options.update(**tlsOptions[server])
    import bottle
    app = bottle.default_app()
    loadErrors(app)
    loadWebUI(app, devel=devel, coffee=coffee)
    loadSaltApi(app, opts)
    if cors:
        loadCors(app)
    app = rebase(base=base)
    logger.info("Running web application server '{0}' on {1}:{2}.".format(server, host, port))
    if base:
        logger.info("URL paths rebased after base '{0}".format(base))
    logger.info('CORS is {0}.'.format(('enabled' if cors else 'disabled')))
    logger.info('TLS/SSL is {0}.'.format(('enabled' if tls else 'disabled')))
    logger.info('Server options: \n{0}'.format(options))
    bottle.run(app=app, server=server, host=host, port=port, debug=devel, reloader=(devel and (not gevented)), interval=1, quiet=False, **options)

dataset/ETHPy150Open saltstack/halite/halite/server_bottle.py startServer/original