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