Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -652,10 +652,19 @@ def send_fcm_notification(
|
|
| 652 |
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 653 |
|
| 654 |
@app.route("/", methods=["GET"])
|
|
|
|
| 655 |
def home():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 656 |
return jsonify({
|
| 657 |
"status": "API is running",
|
| 658 |
"endpoints": {
|
|
|
|
| 659 |
"GET /test": "HTML test console page",
|
| 660 |
"POST /detect": "Face detection + FCM notification",
|
| 661 |
"POST /test-notify": "Send a test push notification"
|
|
@@ -663,12 +672,6 @@ def home():
|
|
| 663 |
})
|
| 664 |
|
| 665 |
|
| 666 |
-
@app.route("/test", methods=["GET"])
|
| 667 |
-
def test_page():
|
| 668 |
-
"""Serve the built-in HTML test console."""
|
| 669 |
-
return render_template_string(TEST_PAGE_HTML)
|
| 670 |
-
|
| 671 |
-
|
| 672 |
@app.route("/detect", methods=["POST"])
|
| 673 |
def detect():
|
| 674 |
|
|
|
|
| 652 |
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 653 |
|
| 654 |
@app.route("/", methods=["GET"])
|
| 655 |
+
@app.route("/test", methods=["GET"])
|
| 656 |
def home():
|
| 657 |
+
"""Serve the HTML test console on both / and /test."""
|
| 658 |
+
return render_template_string(TEST_PAGE_HTML)
|
| 659 |
+
|
| 660 |
+
|
| 661 |
+
@app.route("/api", methods=["GET"])
|
| 662 |
+
def api_info():
|
| 663 |
+
"""JSON info endpoint."""
|
| 664 |
return jsonify({
|
| 665 |
"status": "API is running",
|
| 666 |
"endpoints": {
|
| 667 |
+
"GET /": "HTML test console page",
|
| 668 |
"GET /test": "HTML test console page",
|
| 669 |
"POST /detect": "Face detection + FCM notification",
|
| 670 |
"POST /test-notify": "Send a test push notification"
|
|
|
|
| 672 |
})
|
| 673 |
|
| 674 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 675 |
@app.route("/detect", methods=["POST"])
|
| 676 |
def detect():
|
| 677 |
|