- Install Golang v1.13
- Install soda to create migration database.
We are using Go Gin for Web Framework to build our APIs
Install all Libraries from go mod
go get .
create .env
file
cp .env.example .env
Using soda to up our migration files in the migrations
folder
soda migrate up
Root file in main.go
go run main.go
List Products
Request
GET /api/v1/products
Show Product
Request
GET /api/v1/product/{id}
Create new Product
Request
POST /api/v1/products
Payload :
{
"data": {
"product_name": "Example",
"product_description": "Example description",
"qty": 1
}
}