A simple web API built using Go and PostgreSQL.
- Install Dependencies
govendor sync
- Copy
sample.env
to.env
cp sample.env .env
- Install
go-api-sample
go install
- Run
go-api-sample
go-api-sample
- Access it at http://127.0.0.1:8080/products
- Install Dependencies
govendor sync
- Compile
go-api-sample
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo cmd/api/main.go
- Build Image
docker build . -t salsanads/go-api-sample
- Run Image
docker run --net=host -d -p 8080:8080 salsanads/go-api-sample
- Access it on the host at http://127.0.0.1:8080/products
- Install Dependencies
govendor sync
- Copy
sample.env
to.env
cp sample.env .env
- Run Test
go test -v