Following Tutorial: Developing a RESTful API with Go and Gin.
https://go.dev/doc/tutorial/web-service-gin
James Skemp 39116a1fb7 | ||
---|---|---|
README.md | ||
go.mod | ||
go.sum | ||
main.go |
README.md
Tutorial: Developing a RESTful API with Go and Gin
Following Tutorial: Developing a RESTful API with Go and Gin.
Running
go run .
- Navigate to (GET) http://localhost:8080/albums
- Data to POST to http://localhost:8080/albums:
{"id": "4","title": "The Modern Sound of Betty Carter","artist": "Betty Carter","price": 49.99}
- Navigate to (GET) http://localhost:8080/albums/2
Notes
go mod init example/web-service-gin
A standalone program (as opposed to a library) is always in package main
.
Find where go get
installs packages by running go env
and checking GOMODCACHE
.