Suhas Karanth c21039a284 chore: mv {examples ⮕ _examples}
Avoid pulling in any external example dependencies, when using go get.
Go tools ignore folders with names which start with `_`.
2017-10-23 15:10:09 +05:30

25 lines
481 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()
// Define your handlers
r.GET("/", func(c *gin.Context) {
c.String(http.StatusOK, "Hello World!")
})
r.GET("/ping", func(c *gin.Context) {
c.String(http.StatusOK, "pong")
})
// Handle all requests using net/http
http.Handle("/", r)
}