Skip to content
This repository was archived by the owner on Sep 12, 2019. It is now read-only.

Commit 42dada8

Browse files
author
sw-yx
committed
link to docs in hello world function template
1 parent e760e34 commit 42dada8

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/functions-templates/js/hello-world/hello-world.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1+
// Docs on event and context https://www.netlify.com/docs/functions/#the-handler-method
12
exports.handler = async (event, context) => {
23
try {
34
const subject = event.queryStringParameters.name || "World";
4-
return { statusCode: 200, body: `Hello ${subject}` };
5+
return {
6+
statusCode: 200,
7+
body: JSON.stringify({ message: `Hello ${subject}` })
8+
// // more keys you can return:
9+
// headers: { "headerName": "headerValue", ... },
10+
// isBase64Encoded: true,
11+
};
512
} catch (err) {
613
return { statusCode: 500, body: err.toString() };
714
}

0 commit comments

Comments
 (0)