Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,9 +10,10 @@ preprocessor = joblib.load('preprocessor.pkl')
|
|
| 10 |
|
| 11 |
app = Flask(__name__)
|
| 12 |
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
|
|
|
| 16 |
|
| 17 |
@app.route('/predict', methods=['POST'])
|
| 18 |
def predict():
|
|
@@ -36,5 +37,5 @@ def predict():
|
|
| 36 |
|
| 37 |
if __name__ == '__main__':
|
| 38 |
port = int(os.environ.get("PORT", 5000))
|
| 39 |
-
print(f"[{datetime.now()}]
|
| 40 |
app.run(host='0.0.0.0', port=port)
|
|
|
|
| 10 |
|
| 11 |
app = Flask(__name__)
|
| 12 |
|
| 13 |
+
# Health check endpoint
|
| 14 |
+
@app.route('/health', methods=['GET'])
|
| 15 |
+
def health_check():
|
| 16 |
+
return jsonify({"status": "ok", "message": "Backend is running"}), 200
|
| 17 |
|
| 18 |
@app.route('/predict', methods=['POST'])
|
| 19 |
def predict():
|
|
|
|
| 37 |
|
| 38 |
if __name__ == '__main__':
|
| 39 |
port = int(os.environ.get("PORT", 5000))
|
| 40 |
+
print(f"[{datetime.now()}] 🚀 Backend server is starting on port {port}...")
|
| 41 |
app.run(host='0.0.0.0', port=port)
|