OpenFaaS Code Eval

March 17, 2018 ยท View on GitHub

Code eval as a service. Powered by OpenFaaS.

Setup

Spin up OpenFaas:

$ docker swarm init
$ git clone https://github.com/openfaas/faas && \
  cd faas && \
  ./deploy_stack.sh

Run a build with the faas-cli:

$ faas-cli build -f template.yml

Deploy:

$ faas-cli deploy -f template.yml

Test:

$ curl -X POST http://localhost:8080/function/eval -d \
  '{"code": "let test = 4; console.log(test + 21)"}'
{"status":"success","results":"25"}%