commit 7890be2ed24c2f63188f84b9510fd98d31581a51 Author: starnakin Date: Thu Sep 12 23:38:04 2024 +0200 init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b0e884e --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.env +bozo \ No newline at end of file diff --git a/main.py b/main.py new file mode 100644 index 0000000..3cf31a3 --- /dev/null +++ b/main.py @@ -0,0 +1,27 @@ +from flask import Flask, render_template, request, redirect, session +import time + +app = Flask(__name__); + +last_value: str + +try: + with open("bozo", 'r') as f: + last_value: str = f.read() +except: + with open("bozo", 'w+') as f: + last_value = str(time.time() * 1000) + f.write(last_value) + +@app.route("/api/update", methods = ['GET']) +def get(): + return str(last_value) + +@app.route("/api/update", methods = ['POST']) +def update(): + last_value = str(time.time() * 1000) + f.write(last_value) + return + +if __name__ == '__main__': + app.run(host='0.0.0.0', port=5000, debug=1) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..5763f2d --- /dev/null +++ b/requirements.txt @@ -0,0 +1,8 @@ +asarPy==1.0.1 +blinker==1.8.2 +click==8.1.7 +Flask==3.0.3 +itsdangerous==2.2.0 +Jinja2==3.1.4 +MarkupSafe==2.1.5 +Werkzeug==3.0.4