Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -130,6 +130,18 @@ def respond():
|
|
| 130 |
from flask import send_from_directory
|
| 131 |
@app.route("/")
|
| 132 |
def index(): return
|
| 133 |
-
send_from_directory
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 134 |
# Hugging Face Spaces expects an app variable called "app"
|
| 135 |
application = app
|
|
|
|
| 130 |
from flask import send_from_directory
|
| 131 |
@app.route("/")
|
| 132 |
def index(): return
|
| 133 |
+
from flask import send_from_directory
|
| 134 |
+
|
| 135 |
+
@app.route("/")
|
| 136 |
+
def index():
|
| 137 |
+
# Serve index.html from the same directory as app.py
|
| 138 |
+
return send_from_directory(".", "index.html")
|
| 139 |
+
|
| 140 |
+
# ✅ Ensure Flask knows what to serve
|
| 141 |
+
if __name__ == "__main__":
|
| 142 |
+
app.run(host="0.0.0.0", port=7860)
|
| 143 |
+
|
| 144 |
+
# Required for Hugging Face Spaces / OneCompiler
|
| 145 |
+
application = app
|
| 146 |
# Hugging Face Spaces expects an app variable called "app"
|
| 147 |
application = app
|