small change
modify so it matches the actual project
This commit is contained in:
parent
a9e9a5d023
commit
6171344b65
16
main.go
16
main.go
@ -8,17 +8,17 @@ import (
|
||||
|
||||
// album represents data about a record album.
|
||||
type album struct {
|
||||
ID string `json:"id"`
|
||||
Title string `json:"title"`
|
||||
Artist string `json:"artist"`
|
||||
Price string `json:"price"`
|
||||
ID string `json:"id"`
|
||||
Title string `json:"title"`
|
||||
Description string `json:"description"`
|
||||
Filepath string `json:"filepath"`
|
||||
}
|
||||
|
||||
// albums slice to seed record album data.
|
||||
var albums = []album{
|
||||
{ID: "1", Title: "Blue Train", Artist: "John Coltrane", Price: "56.99"},
|
||||
{ID: "2", Title: "Jeru", Artist: "Gerry Mulligan", Price: "17.99"},
|
||||
{ID: "3", Title: "Sarah Vaughan and Clifford Brown", Artist: "Sarah Vaughan", Price: "39.99"},
|
||||
{ID: "1", Title: "Blue Train", Description: "John Coltrane", Filepath: "56.99"},
|
||||
{ID: "2", Title: "Jeru", Description: "Gerry Mulligan", Filepath: "17.99"},
|
||||
{ID: "3", Title: "Sarah Vaughan and Clifford Brown", Description: "Sarah Vaughan", Filepath: "39.99"},
|
||||
}
|
||||
|
||||
func remove(slice []album, s int) []album {
|
||||
@ -27,6 +27,8 @@ func remove(slice []album, s int) []album {
|
||||
|
||||
func main() {
|
||||
router := gin.Default()
|
||||
router.SetTrustedProxies(nil)
|
||||
|
||||
router.GET("/albums", getAlbums)
|
||||
router.GET("/albums/:id", getAlbumByID)
|
||||
router.POST("/albums", postAlbums)
|
||||
|
Loading…
Reference in New Issue
Block a user