Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
alexellis authored Apr 14, 2017
1 parent e2581ec commit 47a16de
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,33 @@ This CLI can be used to build and deploy functions to FaaS.
This will generate a Docker image for Node.js.

```
$ faas-cli -action=build -image=alexellis2/hello-function
$ ./faas-cli -action=build -image=alexellis2/hello-function -name=hello-function -handler=./samples/info
Building: alexellis2/hello-cli with Docker. Please wait..
...
Image: alexellis2/hello-cli built.
```

This will use the handler.js file found in the template/node folder to build a Docker image containing the FaaS watchdog.

**Deploy the Docker image as a FaaS function:**

Now we can deploy the image as `hellofunction`.
Now we can deploy the image as a named function called `hello-function`.

```
$ faas-cli -action=deploy -image=alexellis2/hello-function -name=hellofunction
$ ./faas-cli -action=deploy -image=alexellis2/hello-function -name=hello-function
200 OK
URL: http://localhost:8080/function/hellofunction
URL: http://localhost:8080/function/hello-function
```

**Accessing the function:**

You can pass input with the `-d` flag or `--data-binary @filename.txt` to send a whole file including newlines.

```
$ curl -d '{"hello": "world"}' http://localhost:8080/function/hellofunction
$ curl -d '{"hello": "world"}' http://localhost:8080/function/hello-function
```

**Installation (require Go 1.7 or later)**
Expand Down

0 comments on commit 47a16de

Please sign in to comment.