A simple Dockerised API server using Golang and PostgreSQL.
- internal
|
/app
/api_helper.go
/api.go
/dal.go
/models.go
/repo.go
/router.go
/server.go
- migration
|
/initial_migration.sql
- docker-compose.yml
- go.mod
- go.sum
- main.go
docker-compose == 1.29.2
Golang == 1.16
git clone {github url here} golang-simple-api-servercd golang-simple-api-serverdocker-compose up -dgo build -o app ./appGo to your browser : http://127.0.0.1:3000/api/
{
"name": "category1",
"parent_category": 3
}{
"name": "product1",
"price": 100,
"category_ids": [
1,
2
]
}{
"id": 1,
"name": "Product1",
"price": 1200
}