Skip to content

mathleite/simple-go-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Go Api

Setup

Just build docker with:

docker-compose up --build -d

Server

To start:

  • Enter inside golang container:
     docker-compose exec golang bash
  • Build and run serve
     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:

{
	"isbn": "432432",
	"title": "Andorinha",
	"author": {
		"firstname": "Carol",
		"lastname": "Williams"
	}
}