Replace FN_ROUTE with FN_PATH

This commit is contained in:
Travis Reeder
2017-09-20 11:35:18 -07:00
parent cdb74915de
commit 904f288ed6
6 changed files with 10 additions and 10 deletions

View File

@@ -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
}

View File

@@ -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