From 9735b87c45f972765f514edb1865d2d69448c43a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=B1=BC=E9=AA=A8=E5=89=AA?= <1580622474@qq.com> Date: Thu, 8 Aug 2024 21:18:50 +0800 Subject: [PATCH] Init --- app.py | 38 ++++++++++++++++++++++++++++++++++++++ index.html | 28 ++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 app.py create mode 100644 index.html diff --git a/app.py b/app.py new file mode 100644 index 0000000..512042a --- /dev/null +++ b/app.py @@ -0,0 +1,38 @@ +from flask import Flask, jsonify +from flask_cors import CORS +import threading +import paramiko +import time + +#region 全局 + +app = Flask(__name__) +CORS(app) +port = 15002 + +#endregion + +#region 接口 + +# 测试用 +@app.route('/') +def hello(): + return 'hi. —— CheckGPUsWeb' + +@app.route('/data', methods=['GET']) +def get_data(): + data = {'name': 'John', 'age': 25, 'city': 'New York'} + return jsonify(data) + +# 开始连接服务器 +def connect_server(): + pass + +#endregion + +# 测试 +def test(): + app.run(debug=True, port=port) + +if __name__ == '__main__': + test() \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..3312985 --- /dev/null +++ b/index.html @@ -0,0 +1,28 @@ + + +
+ + +