Skip to content

Commit

Permalink
Add endpoint to retrieve items
Browse files Browse the repository at this point in the history
  • Loading branch information
shem8 committed Oct 15, 2024
1 parent f463a10 commit 84b0e64
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions backend/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,16 @@ func healthcheck(c *gin.Context) {
"status": "ok",
})
}

func getItems(c *gin.Context) {
items := []gin.H{
{"id": 1, "name": "Galactic Goggles"},
{"id": 2, "name": "Meteor Muffins"},
{"id": 3, "name": "Alien Antenna Kit"},
{"id": 4, "name": "Starlight Lantern"},
{"id": 5, "name": "Quantum Quill"},
}
c.JSON(http.StatusOK, items)
}

router.GET("/items", getItems)

0 comments on commit 84b0e64

Please sign in to comment.