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

https://github.com/mathleite/simple-go-api

Simple CRUD api
https://github.com/mathleite/simple-go-api

api crud docker golang hacktoberfest mux

Last synced: about 2 months ago
JSON representation

Simple CRUD api

Awesome Lists containing this project

README

          

Simple Go Api

## Setup

Just **build** docker with:
```bash
docker-compose up --build -d
```

## Server

To start:
* Enter inside `golang` container:
```bash
docker-compose exec golang bash
```
* Build and run serve
```go
go build && ./app
```

The server will be allocate on `http://localhost/api/books`

Config:
* Header: `Content-Type application/json`

## How it's works?

You can use:
- **POST** to create Books;
- **GET** to get Books and specific Book by **ID**;
- **DELETE** to delete Book by **ID**;
- **PUT** to update Book by **ID**

#### Example

**Create** Book:
```json
{
"isbn": "432432",
"title": "Andorinha",
"author": {
"firstname": "Carol",
"lastname": "Williams"
}
}
```