Skip to content

Commit

Permalink
Changed routes' path 'people/route-name' to adhere with REST API endp…
Browse files Browse the repository at this point in the history
…oints path.
  • Loading branch information
niccolozanotti committed Sep 4, 2024
1 parent 91bd19b commit eed8fc1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lambda_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand All @@ -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']
Expand All @@ -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",
Expand Down

0 comments on commit eed8fc1

Please sign in to comment.