Compare commits

...

2 commits

Author SHA1 Message Date
94d4e16cfd 一応ダミーページを返すように 2024-06-08 20:26:26 +09:00
c1e9ca4878 ダミー用 2024-06-08 20:26:11 +09:00
2 changed files with 14 additions and 4 deletions

View file

@ -1,7 +1,7 @@
import psycopg2
import os
import json
from flask import Flask, request, jsonify
from flask import Flask, request, jsonify, render_template
config_dir_path = "./config/"
db_config_path = config_dir_path + "db.json"
@ -41,7 +41,7 @@ class Auth():
self.db.commit()
app = Flask(__name__)
app = Flask(__name__, static_folder="./resource/")
auth = Auth(db_config["host"], db_config["db"], db_config["port"], db_config["username"], db_config["password"])
@app.route('/verify', methods=['POST'])
@ -51,9 +51,9 @@ def verify():
if auth.check(pc_number, password) == 0:
auth.delete(pc_number)
return jsonify({'message': 'ok'}), 200
return render_template("verify.html"), jsonify({'message': 'ok'}), 200
else:
return jsonify({'message': 'damedesu'}), 401
return render_template("verify.html"), jsonify({'message': 'damedesu'}), 401
if __name__ == '__main__':
app.run()

10
resource/verify.html Normal file
View file

@ -0,0 +1,10 @@
<html>
<head>
<title>Verify</title>
</head>
<body>
<h1>だめです</h1>
</body>
</html>