It is a just simple RESTful API with Go using:
- Gin Framework
- Gorm
This Gin GORM API Boilerplate with MVC paradigm.
Setting DB in main.go
make init
After build: localhost:8080
Db connection: .env
Default server port in dockerfile: ENV PORT 8080, external port in docker-compose.yml.
├── docker
│ └── app
│ └── Dockerfile
├── src
│ ├── Models
│ │ ├── Book.go // Book models
│ | ├── Scheme.go // Book struct and tabel
│ ├── Config
│ │ └── Database.go // Global DB
│ ├── Controllers
│ │ └── Book.go // Book Controller
│ ├── ApiHelpers
│ │ └── Response.go // response function
│ └── Routers
│ └── Routers.go // Routers
└── main.go
GET
: Get all bookPOST
: Create a new book
GET
: Get a bookPUT
: Update a bookDELETE
: Delete a book
#Post Params
{
"author": "Op Super John Doe Bilw",
"name": "Implementation Golang",
"category": "Knowledge"
}