mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Add README for hotfunctions go example and update docs to point to it
This commit is contained in:
22
examples/tutorial/hotfunctions/http/go/README.md
Normal file
22
examples/tutorial/hotfunctions/http/go/README.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# Hot Function Example
|
||||
|
||||
This is an example of a hot function. The [hot function documentation](/docs/hot-functions.md) contains an analysis of how this example works.
|
||||
|
||||
### How to run the example
|
||||
|
||||
Install the CLI tool, start a Fn server and run `docker login` to login to DockerHub. See the [front page](README.md) for instructions.
|
||||
|
||||
Set your Docker Hub username
|
||||
|
||||
```export FN_REGISTRY=<DOCKERHUB_USERNAME>
|
||||
```
|
||||
|
||||
Build and deploy the function to the Fn server (default localhost:8080)
|
||||
|
||||
fn deploy --app hot-app
|
||||
```
|
||||
|
||||
Now call your function:
|
||||
|
||||
```curl -X POST -d "World" http://localhost:8080/r/hot-app/%2Fhotfn-go
|
||||
```
|
||||
6
examples/tutorial/hotfunctions/http/go/func.yaml
Normal file
6
examples/tutorial/hotfunctions/http/go/func.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
name: hotfunction-http
|
||||
version: 0.0.10
|
||||
runtime: go
|
||||
entrypoint: ./func
|
||||
format: http
|
||||
path: /hotfn-go
|
||||
@@ -1,6 +0,0 @@
|
||||
{"route":{
|
||||
"memory": 64,
|
||||
"type": "sync",
|
||||
"config": null,
|
||||
"format": "http"
|
||||
}}
|
||||
Reference in New Issue
Block a user