getting-started: listen on PORT
@@ -25,8 +25,6 @@ import (
"github.com/gorilla/mux"
uuid "github.com/satori/go.uuid"
- "google.golang.org/appengine"
-
"github.com/GoogleCloudPlatform/golang-samples/getting-started/bookshelf"
)
@@ -38,8 +36,12 @@ var (
)
func main() {
+ port := os.Getenv("PORT")
+ if port == "" {
+ port = "8080"
+ }
registerHandlers()
- appengine.Main()
+ log.Fatal(http.ListenAndServe(fmt.Sprintf(":%s", port), nil))
}
func registerHandlers() {
