From 86fdaa292093f503572b9aee92fc81b71bce3651 Mon Sep 17 00:00:00 2001 From: "Kwiatosz, Krzysztof" Date: Wed, 9 Aug 2023 09:42:16 +0200 Subject: [PATCH 1/2] Unify sample function in docs --- .../02-deploy-expose-function.md | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/docs/02-get-started/02-deploy-expose-function.md b/docs/02-get-started/02-deploy-expose-function.md index 768a919d1a8e..bbfbe0d4301d 100644 --- a/docs/02-get-started/02-deploy-expose-function.md +++ b/docs/02-get-started/02-deploy-expose-function.md @@ -20,17 +20,8 @@ First, let's create the Function and apply it. 4. Name the Function `hello-world`. 5. From the **Language** dropdown, choose `JavaScript`. 6. From the **Runtime** dropdown, choose one of the available `nodejs`. -7. Paste the following source code: -```javascript -module.exports = { - main: async function (event, context) { - const message = `Hello Serverless` - console.log(message); - return message; - } -} -``` -7. Click **Create**. +7. Keep the sample function code. +8. Click **Create**.
@@ -53,7 +44,10 @@ spec: source: | module.exports = { main: function(event, context) { - return 'Hello Serverless' + const message = `Hello World` + + ` from the Kyma Function ${context['function-name']}` + + ` running on ${context.runtime}!`; + return message; } } EOF @@ -182,7 +176,7 @@ Run: curl https://hello-world.$CLUSTER_DOMAIN ``` -The operation was successful if the call returns `Hello Serverless`. +The operation was successful if the call returns `Hello World from the Kyma Function hello-world running on nodejs18!`.
From 0f53bf8d8077a1ddddcee85c0574d5ac12f95116 Mon Sep 17 00:00:00 2001 From: Krzysztof Kwiatosz Date: Wed, 9 Aug 2023 10:28:43 +0200 Subject: [PATCH 2/2] Update docs/02-get-started/02-deploy-expose-function.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Małgorzata Świeca --- docs/02-get-started/02-deploy-expose-function.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/02-get-started/02-deploy-expose-function.md b/docs/02-get-started/02-deploy-expose-function.md index bbfbe0d4301d..26d06707b95b 100644 --- a/docs/02-get-started/02-deploy-expose-function.md +++ b/docs/02-get-started/02-deploy-expose-function.md @@ -20,7 +20,7 @@ First, let's create the Function and apply it. 4. Name the Function `hello-world`. 5. From the **Language** dropdown, choose `JavaScript`. 6. From the **Runtime** dropdown, choose one of the available `nodejs`. -7. Keep the sample function code. +7. Keep the sample Function code. 8. Click **Create**.