This commit is contained in:
Jay
2019-02-25 22:56:48 +08:00
commit 0dc1db02b0
9 changed files with 305 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
package routes
import (
"github.com/gin-gonic/gin"
"net/http"
)
// NewEngine -
func NewEngine () *gin.Engine {
engine := gin.New()
engine.Use(gin.Logger())
engine.Use(gin.Recovery())
return engine
}
// SetRoutes -
func SetRoutes(r *gin.Engine) {
r.GET("/", func (c *gin.Context) {
c.JSON(http.StatusOK, gin.H{
"message": "success",
})
})
}