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

Deploying a simple function

Now that we have our Funktion deployment up-and-running, we can look at deploying a really simple hello world example. In the /Chapter05/hello-world/src folder in the GitHub repository that supports this book, you will find a file called hello.js. This file contains the following code:

module.exports = function(context, callback) {  var name = context.request.query.name || context.request.body || "World";  callback(200, "Hello " + name + "!!");};

Running the following command in the /Chapter05/hello-world/ folder will create our first function using the preceding code:

$ funktion create fn -f src/hello.js

The output should look like this: 

As you can see from the Terminal output, this has created a function called ...

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