tree: 7676b69e7d0e5b68fbe15e9a446fa0b2554c4e81 [path history] [tgz]
  1. build.yaml.tmpl
  2. data-init.json
  3. data-run.json
  4. payload-knative-init-run.http
  5. payload-openwhisk-init.http
  6. payload-openwhisk-run.http
  7. README.md
  8. service.yaml.tmpl
knative-build/runtimes/javascript/tests/helloworld/README.md

Hello World Test for OpenWhisk NodeJS Runtime using Knative

Running the test using the “Curl” command

Depending on the value you set in buildtemplate.yaml for the OW_RUNTIME_PLATFORM parameter, you will need to invoke different endpoints to execute the test.

Running with OW_RUNTIME_PLATFORM set to “knative”

Invoke / endpoint on the Service

curl -H "Host: nodejs-helloworld.default.example.com" -X POST http://localhost/

Running with OW_RUNTIME_PLATFORM set to “openwhisk”

Initialize the runtime

Initialize the runtime with the function and other configuration data using the /init endpoint.

curl -H "Host: nodejs-helloworld.default.example.com" -d "@data-init.json" -H "Content-Type: application/json" http://localhost/init

{"OK":true}

Run the function

Execute the function using the /run endpoint.

curl -H "Host: nodejs-helloworld.default.example.com" -d "@data-run.json" -H "Content-Type: application/json" -X POST http://localhost/run

{"payload":"Hello"}