A mirror of my website's source code.

Important information: Google announced that, from September 2026, Android devices will require ALL apps to be signed by Google, effectively leading to an iOS situation. Value your right to a computer that does what you want; do not tolerate this monopolistic practice! Contact me if you don't understand why it is bad. Click to learn more.

 local_server.py

View raw Download
text/x-script.python • 484 B
Python script, ASCII text executable
        
            
1
from flask import Flask, send_file as SendFile
2
from os.path import exists as PathExists, join as JoinPath
3
4
app = Flask(__name__)
5
6
@app.route("/")
7
def Index():
8
return SendFile("index.html")
9
10
@app.route("/<path:path>")
11
def Other(path):
12
FindFile = JoinPath("..", path).replace("\\", "/")
13
print(FindFile)
14
if PathExists(FindFile):
15
return SendFile(FindFile)
16
return SendFile("../404.html"), 404
17
18
if __name__ == "__main__":
19
app.run("0.0.0.0", 9000, debug=True)