diff --git a/README.md b/README.md index b123eb66d83a2bdc67f8f0695b7698df4c43972e..1dbb7c1f7918d81b530b11e96bacb7f9404d4b46 100644 --- a/README.md +++ b/README.md @@ -20,5 +20,44 @@ This repository contains the source code for a RESTful web service written in Go Clone the repository to your local machine: ```sh -git clone https://github.com/your-username/library-stats-service.git -cd library-stats-service +git clone https://git.gvk.idi.ntnu.no/ab/assignment1.git +cd assignment1 +``` + +### Running the Service + +To run the service locally, navigate to the project directory and execute: + +```sh +go run main.go +``` + +This will start the server on `localhost:8080`. Ensure there are no errors in the terminal indicating the server has started successfully. + +### Testing the Endpoints + +You can test the endpoints using `curl` or Postman. Here are examples using `curl`: + +- **Get Book Count**: + + ```sh + curl "http://127.0.0.1:8080/librarystats/v1/bookcount/?language=en" + ``` + +- **Get Readership**: + + ```sh + curl "http://127.0.0.1:8080/librarystats/v1/readership/en" + ``` + +- **Service Status**: + + ```sh + curl "http://127.0.0.1:8080/librarystats/v1/status/" + ``` + +Replace `en` with the desired ISO 639-1 language code as needed. + +### Deployment + +The final web service should be deployed on Render. Follow the instructions provided in the course material or Render's documentation to deploy your Go application. Ensure to set the correct environment variables and configurations as required by your application and external services it depends on.