got a basic route going
This commit is contained in:
@@ -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,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")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user