示例#1
0
    if check:
        return check
    result = soar_result(args)

    return result


@app.route('/', methods=['POST', 'GET'])
def index():
    return redirect('/static/index.html')


@app.errorhandler(404)
def f0f(error):
    return json.dumps({"result": '404请求不存在', "status": True}), 404


@app.errorhandler(Exception)
def error_info(error):
    if DEBUG:
        result = str(error)
    else:
        result = '500 error'
    return json.dumps({"result": result, "status": False})


if __name__ == '__main__':
    # TODO 初始环境检查,包括 tmp,soar 目录是否可读写 soar 不存在自动拉取
    if IS_OPEN_BROWESER: open_brower("http://127.0.0.1:%s" % (PORT))
    app.run(threaded=True, host=HOST, port=PORT)
示例#2
0
            passwd=res['pwd'],
            db=res['db'],
        )
        status = True
        result = '连接成功'
    except Exception as e:
        status = False
        result = str(e)
    return json.dumps({'result': result, 'status': status})


@app.route('/', methods=['POST', 'GET'])
def index():
    return redirect('/static/index.html')


@app.errorhandler(404)
def f0f(error):
    return json.dumps({"result": '404请求不存在', "status": True}), 404


@app.errorhandler(Exception)
def error_info(error):
    return json.dumps({"result": str(error), "status": False})


if __name__ == '__main__':
    # TODO 初始环境检查,包括 tmp,soar 目录是否可读写 soar 不存在自动拉取
    open_brower("http://127.0.0.1:%s" % (PORT))
    app.run(threaded=True, host=HOST, port=PORT)
示例#3
0
    if DEBUG:
        print (args)

    check = soar_args_check(args)
    if check:
        return check
    result = soar_result(args)

    return result

@app.route('/',methods=['POST', 'GET'])
def index():
    return redirect('/static/index.html')

@app.errorhandler(404)
def f0f(error):
    return json.dumps({
            "result": '404请求不存在', "status": True}
        ),404

@app.errorhandler(Exception)
def error_info(error):
    return json.dumps({
        "result": '500 error', "status": True}
    )

if __name__ == '__main__':
    # TODO 初始环境检查,包括 tmp,soar 目录是否可读写 soar 不存在自动拉取
    open_brower("http://localhost:5077")
    app.run(threaded=True,port=5077)