Below are instructions for requesting and receiving data.
- Python
Clone this repository to your local machine:
git clone <your repo url>
cd <your-repository>
Running Microservice
cd <directory where your file is>
or
python3 usageSocket.py
Open a second terminal to use these commands.
To log a new usage date:
python3 test.py log <insert date yyyy-mm-dd>
To get the count of total usages:
python3 test.py count
To update the last logged date:
python3 test.py update <new date yyyy-mm-dd>
How to interpret the responses from the microservice after making HTTP requests to its endpoints.
When you send a POST request to the /log endpoint:
Response from server: {"status": "Success", "message": "Usage logged"}
When you send a GET request to the /count endpoint:
Response from server: {"count": 1}
This response indicates the total number of usage logs recorded.
When you send a PUT request to the /update endpoint:
Response from server: {"status": "Success", "message": "Last entry updated"}
