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

Get Kubernetes for Serverless Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.