Add /albums GET endpoint

Signed-off-by: Oliver Davies <oliver@oliverdavies.uk>
This commit is contained in:
Oliver Davies 2025-09-30 13:37:45 +01:00
parent 0ad9ff73bf
commit a10fc038fd
4 changed files with 40 additions and 2 deletions

View file

@ -4,11 +4,15 @@ import (
"net/http"
"github.com/gin-gonic/gin"
"code.oliverdavies.uk/opdavies/lab/go-gin/internal/lib"
)
func main() {
r := gin.Default()
r.GET("/albums", lib.GetAlbums)
r.GET("/ping", func(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{
"message": "pong",