Go function template for OpenFaas that uses julienschmidt/httprouter. Can be deployed to OpenFaas or can run locally as a webserver
Default webserver port (local): 8201
- Install go modules dependencies
- Run
scripts/build_binary.sh
- it will build go binary and will put it intofunction/dist/handler
- You can run the binary itself and it will start local server. ; Or you can run
faas-cli build -f openfaas.yml
and it will build docker image that can be deployed to OpenFaas
This approach is not tied to golang
only, since it uses dockerfile and builds and image based on alpine linux
you can cuztomize dockerfile and put any executable into it, just make sure that it will listen to a correct port
If there's any improvements etc. that you want to make - feel free to open up an Issue or a PR :) Thanks