An example of gin contains many useful features for e-commerce websites
You can see the docker compose file here to set up required environment
cp pkg/config/config.sample.yaml pkg/config/config.yaml
pkg/config/config.yaml
environment: production
http_port: 8888
grpc_port: 8889
auth_secret: ######
database_uri: postgres://username:password@host:5432/database
redis_uri: localhost:6379
redis_password:
redis_db: 0
$ go run cmd/api/main.go
2023-09-12T15:18:36.684+0700 INFO http/server.go:58 HTTP server is listening on PORT: 8888
2023-09-12T15:18:36.684+0700 INFO grpc/server.go:53 GRPC server is listening on PORT: 8889
$ go test
go test -timeout 9000s -a -v -coverprofile=coverage.out -coverpkg=./... ./...
or
make unittest
http://localhost:8888/swagger/index.html
0x96b2F7E87786Db12121D66477e87539619aa2c97
0x96b2F7E87786Db12121D66477e87539619aa2c97