Steven Lu e1344a901b Setting logging to release mode in example
Debug causes App Engine to fail building, output looks like this:

```
ERROR    2015-03-22 04:15:01,027 http_runtime.py:285] bad runtime process port ['[GIN-debug] GET   /                         --> web.func\xc2\xb7001 (1 handlers)\n']
```

Setting to ReleaseMode fixes this.
2015-03-22 00:27:47 -04:00

25 lines
488 B
Go

package hello
import (
"net/http"
"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()
gin.SetMode(gin.ReleaseMode)
// Define your handlers
r.GET("/", func(c *gin.Context){
c.String(200, "Hello World!")
})
r.GET("/ping", func(c *gin.Context){
c.String(200, "pong")
})
// Handle all requests using net/http
http.Handle("/", r)
}