January 2018
Intermediate to advanced
318 pages
7h 6m
English
We can now deploy a more complex solution rather than just using the inbuilt echo utility to return a message. In a similar way to the previous hello world scripts we used, we are going to deploy a function, written in Node.js, that takes an input and displays it back to us.
First of all, let's create a working directory:
$ mkdir openwhisk-http$ cd openwhisk-http
Now we have a working directory, create a file that contains the following code and call it hello.js:
function main(args) { var msg = "you didn't tell me who you are." if (args.name) { msg = `hello ${args.name}!` } return {body: `<html><body><h3><center>${msg}</center></h3></body></html>`}}
Now that we have the function that we are going to deploy, we first of all need ...
Read now
Unlock full access