Added Google App Engine Example

This commit is contained in:
Javier Provecho Fernandez 2014-07-02 22:08:37 +02:00
parent 2e50e2cc60
commit 6b5e80901f
2 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,8 @@
application: hello
version: 1
runtime: go
api_version: go1
handlers:
- url: /.*
script: _go_app

View File

@ -0,0 +1,22 @@
package hello
import (
"net/http"
"github.com/gin-gonic/gin"
)
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(200, "Hello World!")
})
r.GET("/ping/", func(c *gin.Context){
c.String(200, "pong")
})
// Handle all requests using net/http
http.Handle("/", r)
}