Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/bernardobarreto/go-gin-basic-rest-api

Sample REST API written with Go using Gin
https://github.com/bernardobarreto/go-gin-basic-rest-api

gin golang rest-api

Last synced: 22 days ago
JSON representation

Sample REST API written with Go using Gin

Awesome Lists containing this project

README

        

## Albums API

### Running
```
go get .
go run .
```

### GET /albums
```
curl http://localhost:3000/albums
```

### GET /albums/:id
```
curl http://localhost:3000/albums/2
```

### POST /albums

```
curl http://localhost:3000/albums \
--include \
--header "Content-Type: application/json" \
--request "POST" \
--data '{"id": "4","title": "The Modern Sound of Betty Carter","artist": "Betty Carter","price": 49.99}'
```