Following Tutorial: Developing a RESTful API with Go and Gin. https://go.dev/doc/tutorial/web-service-gin
Go to file
James Skemp 39116a1fb7 Add functionality to get an individual album 2023-04-15 10:44:40 -05:00
README.md Add functionality to get an individual album 2023-04-15 10:44:40 -05:00
go.mod Add endpoint to get albums 2023-04-15 10:13:20 -05:00
go.sum Add endpoint to get albums 2023-04-15 10:13:20 -05:00
main.go Add functionality to get an individual album 2023-04-15 10:44:40 -05:00

README.md

Tutorial: Developing a RESTful API with Go and Gin

Following Tutorial: Developing a RESTful API with Go and Gin.

Running

  1. go run .
  2. Navigate to (GET) http://localhost:8080/albums
  3. Data to POST to http://localhost:8080/albums: {"id": "4","title": "The Modern Sound of Betty Carter","artist": "Betty Carter","price": 49.99}
  4. 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.