From 02bafb4dc93e5a88cd2273c809e69b05111b701c Mon Sep 17 00:00:00 2001 From: "tom.cat" Date: Mon, 7 Mar 2016 20:13:12 +0900 Subject: [PATCH] =?UTF-8?q?=EC=B6=94=EA=B0=80=EC=A4=91=20..?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.go | 7 +++---- model/group.go | 1 + model/user.go | 4 ++++ route/{page.go => self.go} | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 model/group.go create mode 100644 model/user.go rename route/{page.go => self.go} (79%) diff --git a/main.go b/main.go index debcf10..b992fbd 100644 --- a/main.go +++ b/main.go @@ -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).") func main() { - flag.Parse() + flag.Parse() setMaxProcs() r := gin.Default() - r.Use(ginglog.Logger(3 * time.Second)) + r.Use(ginglog.Logger(3 * time.Second)) r.Use(gin.Recovery()) @@ -47,7 +47,7 @@ func main() { r.StaticFS("/static", route.Static("")) r.GET("/api", route.Api) - r.GET("/page", route.Page) + r.GET("/self", route.Self) r.GET("/metric", route.Metric) r.GET("/health", func(c *gin.Context) { c.String(200, "OK! - mnemonics services are fully operational!") @@ -58,7 +58,6 @@ func main() { r.HTMLRender = util.Default() r.GET("/", route.Index) - glog.Info("bootstrapped application") r.Run() // listen and server on 0.0.0.0:8080 } diff --git a/model/group.go b/model/group.go new file mode 100644 index 0000000..0c3b4f2 --- /dev/null +++ b/model/group.go @@ -0,0 +1 @@ +package model \ No newline at end of file diff --git a/model/user.go b/model/user.go new file mode 100644 index 0000000..ef17aef --- /dev/null +++ b/model/user.go @@ -0,0 +1,4 @@ +package model + + +inter \ No newline at end of file diff --git a/route/page.go b/route/self.go similarity index 79% rename from route/page.go rename to route/self.go index 2a65453..604a948 100644 --- a/route/page.go +++ b/route/self.go @@ -2,7 +2,7 @@ package route import "github.com/gin-gonic/gin" -func Page(c *gin.Context) { +func Self(c *gin.Context) { content := gin.H{"Hello": "World"} c.JSON(200, content) }