This commit is contained in:
Oliver
2025-10-06 16:59:23 -03:00
parent ff60112ddf
commit 018e60896c
6 changed files with 571 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
#!/usr/bin/env python3
from flask import Flask, send_from_directory
import os
app = Flask(__name__)
directory = os.getcwd() # serve current directory
@app.route("/", defaults={"path": "index.html"})
@app.route("/<path:path>")
def serve_file(path):
# If file exists, serve it
if os.path.isfile(os.path.join(directory, path)):
return send_from_directory(directory, path)
else:
return f"File not found: {path}", 404
if __name__ == "__main__":
# debug=True enables auto-reload when this file changes
app.run(host="0.0.0.0", port=8000, debug=True)