From 84b0e646b36382398062da097c7883e298ef7aeb Mon Sep 17 00:00:00 2001 From: Shem Date: Tue, 15 Oct 2024 11:03:26 +0000 Subject: [PATCH] Add endpoint to retrieve items --- backend/main.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/backend/main.go b/backend/main.go index eddf46a..b4f6875 100644 --- a/backend/main.go +++ b/backend/main.go @@ -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) \ No newline at end of file