From 6cf8b4cdce3a41461f0f2db8e39ceb3ddf6b83b2 Mon Sep 17 00:00:00 2001 From: Andi Hafner Date: Thu, 26 Jun 2025 18:41:16 +0200 Subject: [PATCH] Update README.md Add examples for the URL syntax. --- README.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1580f927..3ca3abae 100644 --- a/README.md +++ b/README.md @@ -23,12 +23,18 @@ python app.py 1. app.py: A flask application that exposes the following API endpoints: - index at / : Retun a JSON data structure indicating the current balance. - - deposit at /deposit : Take the deposit amount as a URL parameter and return the new balance after adding the amount. - - withdraw at /withdraw : Take the withdrawal amount as a URL parameter and return the new balance after subtracting the amount. + - deposit at /deposit : Take the deposit amount as a URL parameter and return the new balance after adding the amount, e.g. +``` +http://localhost:5000/deposit?amount=50 +``` + - withdraw at /withdraw : Take the withdrawal amount as a URL parameter and return the new balance after subtracting the amount, e.g. + ``` +http://localhost:5000/withdraw?amount=30 +``` App relies on a global in-memory variable (`balance`) to store the balance of the account. 2. requirements.txt: A text file including all the Python libraries and packages needed to run the app. 3. .gitignore: Refer to the gitignore article for more details. In short, this file makes it possible that local configuration or binary files are not pushed to the repository. -4. tests: It's a directory that includes several unit tests for the APIs. The tests utilize the PyTest library. \ No newline at end of file +4. tests: It's a directory that includes several unit tests for the APIs. The tests utilize the PyTest library.