Add /albums GET endpoint
Signed-off-by: Oliver Davies <oliver@oliverdavies.uk>
This commit is contained in:
parent
0ad9ff73bf
commit
a10fc038fd
4 changed files with 40 additions and 2 deletions
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue