The Album Service is a web service that allows users to create and search for albums.
- Clone the repository:
git clone https://github.com/willian2s/web-service-gin.git
- Install the dependencies:
go mod download
- Start the development server:
air
or
go run .
To list all albums, send a GET request to the /albums
endpoint:
curl http://localhost:8080/albums
{
"id": "b3997ac1-c367-40e3-8327-223ef777355c",
"title": "Blue Train",
"artist": "John Coltrane",
"price": 56.99
},
{
"id": "60831261-8bd1-4fb3-9df7-99f75a003caf",
"title": "Jeru",
"artist": "Gerry Mulligan",
"price": 17.99
},
To create an album, send a POST request to the /albums
endpoint:
curl http://localhost:8080/albums \
--include \
--header "Content-Type: application/json" \
--request "POST" \
--data '{"title": "The Modern Sound of Betty Carter","artist": "Betty Carter","price": 49.99}'
Contributions are welcome! Please follow the contribution guidelines.
This project is licensed under the MIT License.