A REST API written in golang with swagger documentation included.
go run .
- run the applicationgo build .
- build the application (creates an executable)go get .
- get all dependenciesgo mod init rest-to-go-api
- create a new modulecurl http://localhost:8080/albums
- get all albumsgo install github.com/swaggo/swag/cmd/swag@latest
- install swag (for swagger documentation)export PATH=$(go env GOPATH)/bin:$PATH
- add go bin to path (for swag if not working)
go get -u github.com/swaggo/gin-swagger
- install gin-swaggergo get -u github.com/swaggo/files
- install files (for swagger)swag init
- generate swagger documentation (run this in the root of the project each time to update the documentation)docker build -t rest-to-go-api .
- build docker imagedocker run -p 8080:8080 rest-to-go-api
- run docker image