Created
November 18, 2015 03:23
Revisions
-
jonathaningram created this gist
Nov 18, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ Deploy it for prod: ``` $ goapp deploy . ``` Go to http://gae-test-1133.appspot.com/ (or replace with <your app id>) and notice that only one the runtime `HELLO` is the correct value: `prefetched: "", runtime: "hello world"` Now run it in dev: ``` $ goapp serve . ``` Go to http://localhost:8080 and both values are right: `prefetched: "hello world", runtime: "hello world"` ``` $ goapp version go version go1.4.2 (appengine-1.9.28) darwin/amd64 ``` This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ package main import ( "fmt" "log" "net/http" "os" ) var hello string func init() { hello = os.Getenv("HELLO") log.Println(hello) http.Handle("/", http.HandlerFunc(handle)) } func handle(w http.ResponseWriter, r *http.Request) { w.Write([]byte(fmt.Sprintf("prefetched: %q, runtime: %q", hello, os.Getenv("HELLO")))) } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ application: gae-test-1133 # or <your app id> module: default version: 1 runtime: go api_version: go1 includes: - env.yaml handlers: - url: /.* script: _go_app This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,2 @@ env_variables: HELLO: 'hello world'