Download app.py from rtian001/flask: direct link, hf CLI and curl.
- Browser
- Download file 704 Bytes
-
https://huggingface.co/spaces/rtian001/flask/resolve/main/app.py
- Command line
-
hf download hf://spaces/rtian001/flask/app.py
-
curl -L -o app.py https://huggingface.co/spaces/rtian001/flask/resolve/main/app.py
704 Bytes
| from flask import Flask,redirect | |
| import os | |
| import main | |
| app = Flask(__name__) | |
| def home(): | |
| #return "TEST: Hello World from Flask in a uWSGI Nginx Docker container with Python ..." | |
| return app.send_static_file("index.html") | |
| def start(): | |
| main.run_start() | |
| os.system("sleep 5") | |
| return redirect("/sub-status") | |
| def stop(): | |
| main.run_stop() | |
| os.system("sleep 2") | |
| return redirect("/sub-status") | |
| def status(): | |
| results=main.get_links() | |
| return results | |
| def catch_all(path): | |
| return app.send_static_file("index.html") | |
| if __name__ == "__main__": | |
| app.run() |