https://github.com/maysa87/api-golang
Simple RESTful web service API with Go and the Gin Web Framework
https://github.com/maysa87/api-golang
Last synced: 3 months ago
JSON representation
Simple 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 (7 months ago)
- Default Branch: main
- Last Pushed: 2024-11-14T16:46:16.000Z (7 months ago)
- Last Synced: 2025-01-14T07:09:48.300Z (5 months ago)
- Language: Go
- Homepage:
- Size: 19.5 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 using postgres as database and Gorm; a repository of data about vintage jazz records.### 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
```