Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maysa87/api-golang
RESTful web service API with Go and the Gin Web Framework
https://github.com/maysa87/api-golang
Last synced: about 14 hours ago
JSON representation
RESTful web service API with Go and the Gin Web Framework
- Host: GitHub
- URL: https://github.com/maysa87/api-golang
- Owner: Maysa87
- Created: 2024-11-13T12:36:05.000Z (1 day ago)
- Default Branch: main
- Last Pushed: 2024-11-13T13:26:47.000Z (1 day ago)
- Last Synced: 2024-11-13T13:49:09.606Z (1 day ago)
- Language: Go
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Api-Golang
RESTful API server with two endpoints; a repository of data about vintage jazz records.
In this project I'll be storing the data in memory.
* Storing data in memory means that the set of albums will be lost each time you stop the server, then recreated when you start it.### Prerequisites
* Go install for Mac
```sh
curl -O https://dl.google.com/go/go1.20.5.darwin-amd64.tar.gz
```* Clone the repo
```sh
git clone https://github.com/Maysa87/api-golang.git
```
* Install Gin package
```sh
go get -u github.com/gin-gonic/gin
```
* To make a request to the running web service and add a new album to the existing list.
```sh
$ curl http://localhost:8080/albums \
--include \
--header "Content-Type: application/json" \
--request "POST" \
--data '{"id": "Number Id", "title": "tittle of the album", "artist": "artist's name", "price": 0.00}'
```* Command to see all album:
```sh
$ curl http://localhost:8080/albums
```