got a basic route going

This commit is contained in:
2026-06-11 19:39:26 -06:00
parent 94c35a9c72
commit 1da9022cf5
2 changed files with 15 additions and 0 deletions
@@ -0,0 +1,11 @@
package controllers
import (
"github.com/gin-gonic/gin"
)
func GetMovies() gin.HandlerFunc {
return func(ginContext *gin.Context) {
ginContext.JSON(200, gin.H{"message": "list of movies"})
}
}
+4
View File
@@ -4,6 +4,8 @@ import (
"fmt" "fmt"
"log" "log"
controller "github.com/captbrogers/MagicStreamServer/controllers"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )
@@ -14,6 +16,8 @@ func main() {
ctx.String(200, "Ahoy matey!") ctx.String(200, "Ahoy matey!")
}) })
router.GET("/movies", controller.GetMovies())
if err := router.Run(":5180"); err != nil { if err := router.Run(":5180"); err != nil {
log.Fatal("failure to start the server") log.Fatal("failure to start the server")
} }