1
0
Fork 0

추가중 ..

This commit is contained in:
tom.cat 2016-03-07 20:13:12 +09:00
parent 96f8d6f794
commit 02bafb4dc9
4 changed files with 9 additions and 5 deletions

View File

@ -32,11 +32,11 @@ var argPort = flag.Int("port", 8080, "port to listen")
var maxProcs = flag.Int("max_procs", 0, "max number of CPUs that can be used simultaneously. Less than 1 for default (number of cores).") var maxProcs = flag.Int("max_procs", 0, "max number of CPUs that can be used simultaneously. Less than 1 for default (number of cores).")
func main() { func main() {
flag.Parse() flag.Parse()
setMaxProcs() setMaxProcs()
r := gin.Default() r := gin.Default()
r.Use(ginglog.Logger(3 * time.Second)) r.Use(ginglog.Logger(3 * time.Second))
r.Use(gin.Recovery()) r.Use(gin.Recovery())
@ -47,7 +47,7 @@ func main() {
r.StaticFS("/static", route.Static("")) r.StaticFS("/static", route.Static(""))
r.GET("/api", route.Api) r.GET("/api", route.Api)
r.GET("/page", route.Page) r.GET("/self", route.Self)
r.GET("/metric", route.Metric) r.GET("/metric", route.Metric)
r.GET("/health", func(c *gin.Context) { r.GET("/health", func(c *gin.Context) {
c.String(200, "OK! - mnemonics services are fully operational!") c.String(200, "OK! - mnemonics services are fully operational!")
@ -58,7 +58,6 @@ func main() {
r.HTMLRender = util.Default() r.HTMLRender = util.Default()
r.GET("/", route.Index) r.GET("/", route.Index)
glog.Info("bootstrapped application") glog.Info("bootstrapped application")
r.Run() // listen and server on 0.0.0.0:8080 r.Run() // listen and server on 0.0.0.0:8080
} }

1
model/group.go Normal file
View File

@ -0,0 +1 @@
package model

4
model/user.go Normal file
View File

@ -0,0 +1,4 @@
package model
inter

View File

@ -2,7 +2,7 @@ package route
import "github.com/gin-gonic/gin" import "github.com/gin-gonic/gin"
func Page(c *gin.Context) { func Self(c *gin.Context) {
content := gin.H{"Hello": "World"} content := gin.H{"Hello": "World"}
c.JSON(200, content) c.JSON(200, content)
} }