pi-calendar/route/routes/routes.go

30 lines
419 B
Go

package routes
import (
"go-cal/route/auth"
"net/http"
"github.com/gin-gonic/gin"
)
// NewEngine -
func NewEngine() *gin.Engine {
e := gin.New()
e.Use(gin.Logger())
e.Use(gin.Recovery())
return e
}
// SetRoutes -
func SetRoutes(e *gin.Engine) {
e.GET("/health", func(c *gin.Context) {
c.String(http.StatusOK, "ok")
})
e.GET("/auth", auth.RedirectToAuth)
e.GET("/auth/verify", auth.OAuthResponse)
}