O'Reilly logo

Kubernetes for Serverless Applications by Russ McKendrick

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Hello world

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required