Table of Contents
This API is for Simple Demo Clean Architecture in Golang application.
- Install go. You can download the Golang in this page. You should install version 1.20
- Install Postgres database. You can download the Postgres in this page. You should install version 14.1
- You run this command to install packages
go mod download
- Create
.env
file from.env.example
file. - You run this command to start
go run app/entry/api/main.go
- You run this command to start
curl --location 'http://localhost:9999/api/v1/migrate' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data-urlencode 'key=yourkeyhere'
- You run this command to start
curl --location 'http://localhost:9999/api/v1/user' \ --header 'Content-Type: application/json' \ --data '{ "user_name": "yourusername" }'
- Run by docker
docker-compose up
- Then you can do from step 4 of
Run via Go