change folder struct

This commit is contained in:
Jay 2018-04-11 17:27:48 +08:00
parent fdfae04892
commit 078461b8cd
2 changed files with 5 additions and 2 deletions

View File

@ -1,7 +1,7 @@
package main package main
import ( import (
"git.trj.tw/golang/go-gallery/modules/routes" "git.trj.tw/golang/go-gallery/routers/routes"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )
@ -9,5 +9,8 @@ var server *gin.Engine
func main() { func main() {
server = routes.NewServ() server = routes.NewServ()
routes.SetDefaultRoutes(server)
server.Run(":10230") server.Run(":10230")
} }

View File

@ -10,7 +10,7 @@ func NewServ() *gin.Engine {
return r return r
} }
// SetDefaultRoutes - set default // SetDefaultRoutes -
func SetDefaultRoutes(r *gin.Engine) { func SetDefaultRoutes(r *gin.Engine) {
r.GET("/", func(c *gin.Context) { r.GET("/", func(c *gin.Context) {
c.JSON(200, gin.H{ c.JSON(200, gin.H{