add oauth flow routes

This commit is contained in:
Jay
2019-12-28 14:38:38 +00:00
parent 369e8d3f6e
commit 6ff437be99
10 changed files with 367 additions and 13 deletions
+29
View File
@@ -0,0 +1,29 @@
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)
}