Skip to content

Commit

Permalink
Unify sample function in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
kwiatekus committed Aug 9, 2023
1 parent 9aafe00 commit 86fdaa2
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions docs/02-get-started/02-deploy-expose-function.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**.
</details>
<details>
<summary label="kubectl">
Expand All @@ -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
Expand Down Expand Up @@ -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!`.

</details>
</div>
Expand Down

0 comments on commit 86fdaa2

Please sign in to comment.