After you have created a Node.js function project, you can modify the template files provided to add business logic to your function.
-
Before you can develop functions, you must complete the steps in Setting up {FunctionsProductName}.
When using the kn
CLI to create a function project, you can generate a project that responds to CloudEvents, or one that responds to simple HTTP requests. CloudEvents in Knative are transported over HTTP as a POST request, so both function types listen for and respond to incoming HTTP events.
Node.js functions can be invoked with a simple HTTP request. When an incoming request is received, functions are invoked with a context
object as the first parameter.
-
See the Node.js context object reference documentation.