diff --git a/README.md b/README.md index 99238d9..53402f6 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ This is my captsone project for IBM. + # DevOps Capstone Template [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) diff --git a/service/routes.py b/service/routes.py index a38ba35..2e2ddac 100644 --- a/service/routes.py +++ b/service/routes.py @@ -13,6 +13,8 @@ ############################################################ # Health Endpoint ############################################################ + + @app.route("/health") def health(): """Health Status""" @@ -22,6 +24,8 @@ def health(): ###################################################################### # GET INDEX ###################################################################### + + @app.route("/") def index(): """Root URL response""" @@ -38,6 +42,8 @@ def index(): ###################################################################### # CREATE A NEW ACCOUNT ###################################################################### + + @app.route("/accounts", methods=["POST"]) def create_accounts(): """ @@ -60,6 +66,8 @@ def create_accounts(): ###################################################################### # LIST ALL ACCOUNTS ###################################################################### + + @app.route("/accounts", methods=["GET"]) def list_accounts(): """ @@ -77,6 +85,8 @@ def list_accounts(): ###################################################################### # READ AN ACCOUNT ###################################################################### + + @app.route("/accounts/", methods=["GET"]) def get_accounts(account_id): """ @@ -93,7 +103,9 @@ def get_accounts(account_id): ###################################################################### # UPDATE AN EXISTING ACCOUNT ###################################################################### -@app.route("/accounts/", methods=["PUT"]) + + +app.route("/accounts/", methods=["PUT"]) def update_accounts(account_id): """ Update an Account @@ -105,7 +117,6 @@ def update_accounts(account_id): account = Account.find(account_id) if not account: abort(status.HTTP_404_NOT_FOUND, f"Account with id [{account_id}] could not be found") - account.deserialize(request.get_json()) account.update() @@ -115,6 +126,7 @@ def update_accounts(account_id): # DELETE AN ACCOUNT ###################################################################### + @app.route("/accounts/", methods=["DELETE"]) def delete_accounts(account_id): """