瀏覽代碼

Fix

Modified ping path and added a comment explaining why init() is called
like that.
Javier Provecho Fernandez 11 年之前
父節點
當前提交
ca91a4a6da
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      examples/app-engine/hello.go

+ 2 - 1
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")
 	})