-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug_server.py
More file actions
31 lines (24 loc) · 674 Bytes
/
Copy pathdebug_server.py
File metadata and controls
31 lines (24 loc) · 674 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from flask import Flask, request
app = Flask(__name__, static_folder="site")
import logging
log = logging.getLogger("werkzeug")
log.setLevel(logging.ERROR)
logs = ""
@app.route("/sendlog")
def msg():
global logs
print("Debug: " + request.args.get("msg"))
logs = "Debug: " + request.args.get("msg") + "<br>" + logs
return "Ok"
@app.route("/")
def home():
global logs
return """<script>
setTimeout(function(){
location.reload();
}, 500)
</script>
<h3>""" + logs + """</h3>"""
if __name__ == "__main__":
ip = "0.0.0.0"
app.run(host=ip, port=8080, debug=True)