diff --git a/api/agent/agent_test.go b/api/agent/agent_test.go index faff2f8e4..255dc07e4 100644 --- a/api/agent/agent_test.go +++ b/api/agent/agent_test.go @@ -66,7 +66,7 @@ func TestCallConfigurationRequest(t *testing.T) { req.Header.Add("MYREALHEADER", "FOOLORD") req.Header.Add("MYREALHEADER", "FOOPEASANT") req.Header.Add("Content-Length", contentLength) - req.Header.Add("FN_ROUTE", "thewrongroute") // ensures that this doesn't leak out, should be overwritten + req.Header.Add("FN_PATH", "thewrongroute") // ensures that this doesn't leak out, should be overwritten call, err := a.GetCall( WithWriter(w), // XXX (reed): order matters [for now] @@ -119,7 +119,7 @@ func TestCallConfigurationRequest(t *testing.T) { expectedBase := map[string]string{ "FN_FORMAT": format, "FN_APP_NAME": appName, - "FN_ROUTE": path, + "FN_PATH": path, "FN_MEMORY": strconv.Itoa(memory), "FN_TYPE": typ, "APP_VAR": "FOO", @@ -210,7 +210,7 @@ func TestCallConfigurationModel(t *testing.T) { env := map[string]string{ "FN_FORMAT": format, "FN_APP_NAME": appName, - "FN_ROUTE": path, + "FN_PATH": path, "FN_MEMORY": strconv.Itoa(memory), "FN_TYPE": typ, "APP_VAR": "FOO", diff --git a/api/agent/call.go b/api/agent/call.go index 2df2f95ba..14821e813 100644 --- a/api/agent/call.go +++ b/api/agent/call.go @@ -189,7 +189,7 @@ func noOverrideVars(key string) bool { var overrideVars = map[string]bool{ "FN_FORMAT": true, "FN_APP_NAME": true, - "FN_ROUTE": true, + "FN_PATH": true, "FN_MEMORY": true, "FN_TYPE": true, "FN_CALL_ID": true, diff --git a/docs/writing.md b/docs/writing.md index ed4b56ada..8ee61e56e 100644 --- a/docs/writing.md +++ b/docs/writing.md @@ -31,7 +31,7 @@ You will also have access to a set of environment variables. * `FN_REQUEST_URL` - the full URL for the request ([parsing example](https://github.com/fnproject/fn/tree/master/examples/tutorial/params)) * `FN_APP_NAME` - the name of the application that matched this route, eg: `myapp` -* `FN_ROUTE` - the matched route, eg: `/hello` +* `FN_PATH` - the matched route, eg: `/hello` * `FN_METHOD` - the HTTP method for the request, eg: `GET` or `POST` * `FN_CALL_ID` - a unique ID for each function execution. * `FN_FORMAT` - a string representing one of the [function formats](function-format.md), currently either `default` or `http`. Default is `default`. diff --git a/examples/blog/function.go b/examples/blog/function.go index f11f69fb3..e467cd0e3 100644 --- a/examples/blog/function.go +++ b/examples/blog/function.go @@ -13,7 +13,7 @@ import ( var noAuth = map[string]interface{}{} func main() { - request := fmt.Sprintf("%s %s", os.Getenv("FN_METHOD"), os.Getenv("FN_ROUTE")) + request := fmt.Sprintf("%s %s", os.Getenv("FN_METHOD"), os.Getenv("FN_PATH")) dbURI := os.Getenv("DB") if dbURI == "" { @@ -36,7 +36,7 @@ func main() { } // GETTING TOKEN - if os.Getenv("FN_ROUTE") == "/token" { + if os.Getenv("FN_PATH") == "/token" { route.HandleToken(db) return } diff --git a/examples/blog/test.sh b/examples/blog/test.sh index 4c5374b85..0f88af951 100755 --- a/examples/blog/test.sh +++ b/examples/blog/test.sh @@ -9,8 +9,8 @@ docker rm test-mongo-func docker run -p 27017:27017 --name test-mongo-func -d mongo -echo '{ "title": "My New Post", "body": "Hello world!", "user": "test" }' | docker run --rm -i -e FN_METHOD=POST -e FN_ROUTE=/posts -e DB=mongo:27017 --link test-mongo-func:mongo -e TEST=1 username/func-blog -docker run --rm -i -e FN_METHOD=GET -e FN_ROUTE=/posts -e DB=mongo:27017 --link test-mongo-func:mongo -e TEST=1 username/func-blog +echo '{ "title": "My New Post", "body": "Hello world!", "user": "test" }' | docker run --rm -i -e FN_METHOD=POST -e FN_PATH=/posts -e DB=mongo:27017 --link test-mongo-func:mongo -e TEST=1 username/func-blog +docker run --rm -i -e FN_METHOD=GET -e FN_PATH=/posts -e DB=mongo:27017 --link test-mongo-func:mongo -e TEST=1 username/func-blog docker stop test-mongo-func docker rm test-mongo-func diff --git a/examples/checker/function.rb b/examples/checker/function.rb index 916305ecc..9d5c5f218 100644 --- a/examples/checker/function.rb +++ b/examples/checker/function.rb @@ -35,7 +35,7 @@ e = ENV["FN_APP_NAME"] if e == nil || e == '' raise "No APP_NAME found" end -e = ENV["FN_ROUTE"] +e = ENV["FN_PATH"] if e == nil || e == '' raise "No ROUTE found" end