1
0
mirror of https://github.com/labstack/echo.git synced 2025-01-01 22:09:21 +02:00
echo/recipe/google-app-engine/app-managed.go
Vishal Rana 2507dc13e9 website and recipe in the main repo
Signed-off-by: Vishal Rana <vr@labstack.com>
2016-10-01 20:49:22 -07:00

30 lines
663 B
Go

// +build appenginevm
package main
import (
"github.com/labstack/echo"
"github.com/labstack/echo/engine/standard"
"google.golang.org/appengine"
"net/http"
"runtime"
)
func createMux() *echo.Echo {
e := echo.New()
// note: we don't need to provide the middleware or static handlers
// for the appengine vm version - that's taken care of by the platform
return e
}
func main() {
// the appengine package provides a convenient method to handle the health-check requests
// and also run the app on the correct port. We just need to add Echo to the default handler
s := standard.New(":8080")
s.SetHandler(e)
http.Handle("/", s)
appengine.Main()
}