From ca91a4a6dad2025b2711cc45ac2bdfad9e810dcd Mon Sep 17 00:00:00 2001 From: Javier Provecho Fernandez Date: Wed, 2 Jul 2014 22:39:42 +0200 Subject: [PATCH] Fix Modified ping path and added a comment explaining why init() is called like that. --- examples/app-engine/hello.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/app-engine/hello.go b/examples/app-engine/hello.go index a6de837..f5daf82 100644 --- a/examples/app-engine/hello.go +++ b/examples/app-engine/hello.go @@ -5,6 +5,7 @@ import ( "github.com/gin-gonic/gin" ) +// This function's name is a must. App Engine uses it to drive the requests properly. func init() { // Starts a new Gin instance with no middle-ware r := gin.New() @@ -13,7 +14,7 @@ func init() { r.GET("/", func(c *gin.Context){ c.String(200, "Hello World!") }) - r.GET("/ping/", func(c *gin.Context){ + r.GET("/ping", func(c *gin.Context){ c.String(200, "pong") })