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

Commit 8583c98

Browse files
author
sw-yx
committed
make hello world template a bit better for demos
1 parent 4709b6e commit 8583c98

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
async function hello() {
2-
return Promise.resolve("Hello, World");
3-
}
4-
5-
exports.handler = async function(event, context) {
1+
exports.handler = async (event, context) => {
62
try {
7-
const body = await hello();
8-
return { statusCode: 200, body };
3+
const subject = event.queryStringParameters.name || "World";
4+
return { statusCode: 200, body: `Hello ${subject}` };
95
} catch (err) {
106
return { statusCode: 500, body: err.toString() };
117
}

0 commit comments

Comments
 (0)