From eed8fc1ff5b8f5661bd043c7a18d52ab66328c5a Mon Sep 17 00:00:00 2001 From: Niccolo' Zanotti Date: Wed, 4 Sep 2024 03:02:53 +0200 Subject: [PATCH] Changed routes' path 'people/route-name' to adhere with REST API endpoints path. --- lambda_function.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lambda_function.py b/lambda_function.py index dd4f7b9..6cb01f0 100644 --- a/lambda_function.py +++ b/lambda_function.py @@ -20,7 +20,7 @@ occupants = set() -@app.route('/register', methods=['POST']) +@app.route('/people/register', methods=['POST']) def register(): data = request.json name = data['name'] @@ -29,7 +29,7 @@ def register(): return jsonify({"status": "registered", "occupants": list(occupants)}) -@app.route('/unregister', methods=['POST']) +@app.route('/people/unregister', methods=['POST']) def unregister(): data = request.json name = data['name'] @@ -38,7 +38,7 @@ def unregister(): return jsonify({"status": "unregistered", "occupants": list(occupants)}) -@app.route('/status', methods=['GET']) +@app.route('/people/status', methods=['GET']) def status(): return jsonify({ "status": "open" if occupants else "closed",