Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -34,6 +34,14 @@ def load_models():
|
|
| 34 |
return False
|
| 35 |
|
| 36 |
# --- TAHAP 2: ENDPOINT PREDIKSI ---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
@app.route('/predict', methods=['POST'])
|
| 38 |
def predict():
|
| 39 |
global model, scaler, jk_encoder, stunting_encoder
|
|
|
|
| 34 |
return False
|
| 35 |
|
| 36 |
# --- TAHAP 2: ENDPOINT PREDIKSI ---
|
| 37 |
+
@app.route('/')
|
| 38 |
+
def home():
|
| 39 |
+
return jsonify({
|
| 40 |
+
"status": "OK",
|
| 41 |
+
"info": "Welcome to the Stunting Prediction API!",
|
| 42 |
+
"how_to_use": "Send POST to /predict with: jenis_kelamin, umur, tinggi, berat"
|
| 43 |
+
})
|
| 44 |
+
|
| 45 |
@app.route('/predict', methods=['POST'])
|
| 46 |
def predict():
|
| 47 |
global model, scaler, jk_encoder, stunting_encoder
|