dorisbot/route/routes/routes.go

31 lines
505 B
Go
Raw Normal View History

2019-09-16 09:16:58 +00:00
package routes
import (
"dorisbot/pkg/context"
"net/http"
"dorisbot/route/private"
"github.com/gin-gonic/gin"
)
// NewEngine -
func NewEngine() *gin.Engine {
e := gin.New()
e.Use(gin.Recovery())
e.Use(gin.Logger())
return e
}
// SetRoutes -
func SetRoutes(e *gin.Engine) {
e.GET("/", func(c *gin.Context) {
c.String(http.StatusOK, "ok")
})
privGroup := e.Group("/private")
{
privGroup.GET("/pages", context.PatchCtx(private.VerifyKey), context.PatchCtx(private.GetFacebookIDs))
}
}