github.com/iron-io/functions@v0.0.0-20180820112432-d59d7d1c40b2/examples/error/README.md (about) 1 # Error Function Image 2 3 This images compares the payload info with the header. 4 5 ``` 6 # Create your func.yaml file 7 fn init <YOUR_DOCKERHUB_USERNAME>/func-error 8 # Build the function 9 fn build 10 # Test it 11 echo '{"input": "yoooo"}' | fn run 12 # Push it to Docker Hub 13 fn push 14 # Create routes to this function on IronFunctions 15 fn apps create <YOUR_APP> 16 fn routes create <YOUR_APP> /error 17 ``` 18 19 ## Running it on IronFunctions 20 21 ### Let's define some environment variables 22 23 ``` 24 # Set your Function server address 25 # Eg. 26 # FUNCAPI=127.0.0.1:8080 27 # APPNAME=error 28 FUNCAPI=YOUR_FUNCTIONS_ADDRESS 29 APPNAME=YOUR_APP 30 ``` 31 32 ### Testing function 33 34 Now that we created our IronFunction route, let's test our new route 35 36 ``` 37 curl -X POST --data '{"input": "yoooo"}' http://$FUNCAPI/r/$APPNAME/error 38 ```