Spaces:
Sleeping
Sleeping
Commit
·
47332b5
1
Parent(s):
2ac1550
update wsgi
Browse files
app.py
CHANGED
|
@@ -105,6 +105,9 @@ def initialize_system():
|
|
| 105 |
"congestion_risk": congestion_risk
|
| 106 |
}
|
| 107 |
|
|
|
|
|
|
|
|
|
|
| 108 |
|
| 109 |
@app.route('/api/status', methods=['GET'])
|
| 110 |
def status():
|
|
|
|
| 105 |
"congestion_risk": congestion_risk
|
| 106 |
}
|
| 107 |
|
| 108 |
+
@app.route("/")
|
| 109 |
+
def home():
|
| 110 |
+
return "Flask is running!"
|
| 111 |
|
| 112 |
@app.route('/api/status', methods=['GET'])
|
| 113 |
def status():
|
wsgi.py
CHANGED
|
@@ -1,18 +1,10 @@
|
|
| 1 |
import os
|
| 2 |
import sys
|
| 3 |
|
|
|
|
| 4 |
if not os.path.exists('route_optimizer.py'):
|
| 5 |
print("Error: route_optimizer.py file not found!")
|
| 6 |
-
print("Please save your original code as 'route_optimizer.py' before running this application.")
|
| 7 |
sys.exit(1)
|
| 8 |
-
import app
|
| 9 |
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
from app import app, initialize_system
|
| 14 |
-
print("Initializing route optimization system...")
|
| 15 |
-
system = initialize_system()
|
| 16 |
-
print(f"System initialized with {len(system['G'].nodes())} nodes and {len(system['G'].edges())} edges")
|
| 17 |
-
|
| 18 |
-
app.run()
|
|
|
|
| 1 |
import os
|
| 2 |
import sys
|
| 3 |
|
| 4 |
+
# Ensure required file exists
|
| 5 |
if not os.path.exists('route_optimizer.py'):
|
| 6 |
print("Error: route_optimizer.py file not found!")
|
|
|
|
| 7 |
sys.exit(1)
|
|
|
|
| 8 |
|
| 9 |
+
# Import only the Flask app instance (Gunicorn will use this)
|
| 10 |
+
from app import app
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|