diff --git a/Introduction/README.md b/Introduction/README.md index 8754b45..e094199 100644 --- a/Introduction/README.md +++ b/Introduction/README.md @@ -34,7 +34,7 @@ In the terminal type the following: The output will be ```yaml -Creating function at: /gofn +Creating function at: ./gofn Runtime: go Function boilerplate generated. func.yaml created. @@ -43,10 +43,10 @@ func.yaml created. The `fn init` command creates an simple function with a bit of boilerplate to get you started. The `--runtime` option is used to indicate that the function we're going to develop will be written in Go. A number of other runtimes are -also supported. Fn creates the simple function along with several supporting files in the `/gofn` directory. +also supported. Fn creates the simple function along with several supporting files in the `./gofn` directory. ### Review your Function File -With your function created change into the `/gofn` directory. +With your function created change into the `./gofn` directory. ![User Input Icon](images/userinput.png) >```sh @@ -61,7 +61,7 @@ Now get a list of the directory contents. >``` ```txt -Gopkg.toml func.go func.yaml +func.go func.yaml go.mod ``` The `func.go` file which contains your actual Go function is generated along @@ -125,9 +125,9 @@ version: 0.0.1 runtime: go entrypoint: ./func triggers: -- name: gofn-trigger +- name: gofn type: http - source: /gofn-trigger + source: /gofn ``` The generated `func.yaml` file contains metadata about your function and @@ -142,7 +142,7 @@ in `--runtime`. in this case `./func` * triggers--identifies the automatically generated trigger name and source. For example, this function would be executed from the URL -. Where appname is the name of +. Where appname is the name of the app chosen for your function when it is deployed. There are other user specifiable properties but these will suffice for @@ -152,7 +152,7 @@ folder name. We'll see this come into play later on. ### Other Function Files The `fn init` command generated one other file. -* `Gopkg.toml` -- the Go dep tool dependency management tool file which +* `go.mod` -- the Go dep tool dependency management tool file which specifies all the dependencies for your function. ## Deploy Your First Function @@ -266,8 +266,8 @@ Successfully tagged fndemouser/gofn:0.0.2 Updating function gofn using image fndemouser/gofn:0.0.2... Successfully created function: gofn with fndemouser/gofn:0.0.2 -Successfully created trigger: gofn-trigger -Trigger Endpoint: http://localhost:8080/t/goapp/gofn-trigger +Successfully created trigger: gofn +Trigger Endpoint: http://localhost:8080/t/goapp/gofn ``` All the steps to load the current language Docker image are displayed. @@ -285,7 +285,7 @@ let's us know that the function is packaged in the image Note that the containing folder name `gofn` was used as the name of the generated Docker container and used as the name of the function that container was bound to. By convention it is also used to create the trigger name -`gofn-trigger`. +`gofn`. Normally you deploy an application without the `--verbose` option. If you rerun the command a new image and version is created and loaded. @@ -392,7 +392,7 @@ We can also see the functions that are defined by an application. Since function ```sh FUNCTION NAME ID TYPE SOURCE ENDPOINT -gofn gofn-trigger 01D37X3AVGNG8G00GZJ0000003 http /gofn-trigger http://localhost:8080/t/goapp/gofn-trigger +gofn gofn 01D37X3AVGNG8G00GZJ0000003 http /gofn http://localhost:8080/t/goapp/gofn ``` The output confirms that `goapp` contains a `gofn` function which may be invoked via the @@ -402,14 +402,14 @@ call our function. ### Invoke with Curl The other way to invoke your function is via HTTP. The Fn server exposes our -deployed function at `http://localhost:8080/t/goapp/gofn-trigger`, a URL +deployed function at `http://localhost:8080/t/goapp/gofn`, a URL that incorporates our application and function trigger as path elements. Use `curl` to invoke the function: ![user input](images/userinput.png) >```sh -> curl -H "Content-Type: application/json" http://localhost:8080/t/goapp/gofn-trigger +> curl -H "Content-Type: application/json" http://localhost:8080/t/goapp/gofn >``` The result is once again the same. @@ -423,7 +423,7 @@ the function back. ![user input](images/userinput.png) >``` -> curl -H "Content-Type: application/json" -d '{"name":"Bob"}' http://localhost:8080/t/goapp/gofn-trigger +> curl -H "Content-Type: application/json" -d '{"name":"Bob"}' http://localhost:8080/t/goapp/gofn >``` The result is once again the same.