all: drop CONFIG_ prefix for configuration (#297)

Fixes #251
This commit is contained in:
C Cirello
2016-11-15 19:19:21 +01:00
committed by Seif Lotfy سيف لطفي
parent 6e58321928
commit 02d3b18497
13 changed files with 40 additions and 42 deletions

View File

@@ -116,12 +116,12 @@ This command should return `{"error":"Invalid authentication"}` because we aren'
First let's create our blog user. In this example an user `test` with password `test`.
```
docker run --rm -e CONFIG_DB=$MONGODB -e NEWUSER='{ "username": "test", "password": "test" }' $USERNAME/functions-blog
docker run --rm -e DB=$MONGODB -e NEWUSER='{ "username": "test", "password": "test" }' $USERNAME/functions-blog
```
##### Getting authorization token
Now, to get authorized to post in our Blog API endpoints we must request a new token with a valid user.
Now, to get authorized to post in our Blog API endpoints we must request a new token with a valid user.
```
curl -X POST --data '{ "username": "test", "password": "test" }' http://$FUNCAPI/r/blog/token

View File

@@ -15,7 +15,7 @@ var noAuth = map[string]interface{}{}
func main() {
request := fmt.Sprintf("%s %s", os.Getenv("METHOD"), os.Getenv("ROUTE"))
dbURI := os.Getenv("CONFIG_DB")
dbURI := os.Getenv("DB")
if dbURI == "" {
dbURI = "127.0.0.1/blog"
}

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 METHOD=POST -e ROUTE=/posts -e CONFIG_DB=mongo:27017 --link test-mongo-func:mongo -e TEST=1 iron/func-blog
docker run --rm -i -e METHOD=GET -e ROUTE=/posts -e CONFIG_DB=mongo:27017 --link test-mongo-func:mongo -e TEST=1 iron/func-blog
echo '{ "title": "My New Post", "body": "Hello world!", "user": "test" }' | docker run --rm -i -e METHOD=POST -e ROUTE=/posts -e DB=mongo:27017 --link test-mongo-func:mongo -e TEST=1 iron/func-blog
docker run --rm -i -e METHOD=GET -e ROUTE=/posts -e DB=mongo:27017 --link test-mongo-func:mongo -e TEST=1 iron/func-blog
docker stop test-mongo-func
docker rm test-mongo-func