DEV Community

badruti94
badruti94

Posted on

membuat file route pada gin

#go
func Router() *gin.Engine {
    router := gin.Default()

    router.GET("/ping", func(c *gin.Context) {
        c.JSON(200, gin.H{
            "message": "pong",
        })
    })


    return router
}

Enter fullscreen mode Exit fullscreen mode

Top comments (0)