Spaces:
Paused
Paused
Delete flask-app
Browse files- flask-app/app.py +0 -25
- flask-app/templates/index.html +0 -11
flask-app/app.py
DELETED
|
@@ -1,25 +0,0 @@
|
|
| 1 |
-
from flask import Flask, render_template, jsonify
|
| 2 |
-
from werkzeug.middleware.dispatcher import DispatcherMiddleware
|
| 3 |
-
from werkzeug.serving import run_simple
|
| 4 |
-
|
| 5 |
-
app = Flask(__name__)
|
| 6 |
-
app.secret_key = "change-this-secret-key" # CHANGE THIS - it is public via the bridge
|
| 7 |
-
app.config["APPLICATION_ROOT"] = "/app" # matches the public path below
|
| 8 |
-
|
| 9 |
-
# ----- Your routes, templates, sessions, login logic stay EXACTLY as they are -----
|
| 10 |
-
|
| 11 |
-
@app.route("/")
|
| 12 |
-
def index():
|
| 13 |
-
return render_template("index.html")
|
| 14 |
-
|
| 15 |
-
@app.route("/status")
|
| 16 |
-
def status():
|
| 17 |
-
return jsonify({"status": "running", "app": "flask-app"})
|
| 18 |
-
|
| 19 |
-
# ------------------------------------------------------------------------------
|
| 20 |
-
|
| 21 |
-
if __name__ == "__main__":
|
| 22 |
-
# Serve the whole app under the /app prefix so url_for() matches the public path,
|
| 23 |
-
# and bind to 0.0.0.0 so the root proxy can reach it.
|
| 24 |
-
wrapped = DispatcherMiddleware(Flask("empty"), {"/app": app})
|
| 25 |
-
run_simple("0.0.0.0", 9001, wrapped)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
flask-app/templates/index.html
DELETED
|
@@ -1,11 +0,0 @@
|
|
| 1 |
-
<!DOCTYPE html>
|
| 2 |
-
<html>
|
| 3 |
-
<head>
|
| 4 |
-
<title>My Flask App</title>
|
| 5 |
-
</head>
|
| 6 |
-
<body>
|
| 7 |
-
<h1>Hi user go</h1>
|
| 8 |
-
<p>This is a full Flask app running on internal port 9001, bridged at /app.</p>
|
| 9 |
-
<p><a href="/app/status">Check status</a></p>
|
| 10 |
-
</body>
|
| 11 |
-
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|