diff --git a/main.py b/main.py index ee07b023e5a900314a759875aaa8b05f9c4deb5d..010b435ac9bffadb5ec711b914e5c6c207799668 100644 --- a/main.py +++ b/main.py @@ -1,25 +1,13 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -from flask import Flask, render_template, jsonify -import dataset +from flask import Flask, render_template app = Flask(__name__) -# 连接到SQLite数据库 -db = dataset.connect('sqlite:///resources/urls.db') - @app.route('/') def index(): return render_template('index.html') -@app.route('/api/prompts') -def get_cards(): - # 获取 cards 表中的所有数据 - cards = db['cards'].all() - print(list(cards)) - # 将数据转换为 JSON 格式,并返回 - return jsonify(cards=list(cards)) - if __name__ == '__main__': - app.run(debug=True,host="0.0.0.0",port=5001) \ No newline at end of file + app.run(port=5002) \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 5dba0c0907b551ec7d6d2a691edcd8101a5af7d5..edebb6f43b0556d6deaaddde0d32e74ee249751d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1 @@ -flask -dataset \ No newline at end of file +flask \ No newline at end of file diff --git a/resources/urls.db b/resources/urls.db deleted file mode 100644 index 8e763312608e343f2bfb5ce9bad4ffe9e0007770..0000000000000000000000000000000000000000 Binary files a/resources/urls.db and /dev/null differ diff --git a/resources/urls.db-shm b/resources/urls.db-shm deleted file mode 100644 index 100cd60c3ce282a88127030ed720f717de763440..0000000000000000000000000000000000000000 Binary files a/resources/urls.db-shm and /dev/null differ diff --git a/resources/urls.db-wal b/resources/urls.db-wal deleted file mode 100644 index 7e1b35219e92a5bc750f2997585634c486b00eb6..0000000000000000000000000000000000000000 Binary files a/resources/urls.db-wal and /dev/null differ diff --git a/templates/index.html b/templates/index.html index f74dced4fb2931594dfadcd7e74e525e9411285e..d17e146f817bb9223c750bfa66eb851be45b5cd4 100644 --- a/templates/index.html +++ b/templates/index.html @@ -49,12 +49,1342 @@ diff --git a/urls.db b/urls.db deleted file mode 100644 index 8e763312608e343f2bfb5ce9bad4ffe9e0007770..0000000000000000000000000000000000000000 Binary files a/urls.db and /dev/null differ