Skip to content

Commit b8d790b

Browse files
committed
add a callback example
1 parent d272e5a commit b8d790b

File tree

1 file changed

+8
-6
lines changed
  • examples/sst/packages/functions/src

1 file changed

+8
-6
lines changed
Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
export const handler = async () => {
2-
console.log("TODO LIST", JSON.stringify({ MESSAGE:[{ id: 1, text: "TODO 1" }]}));
3-
4-
return {
1+
import { APIGatewayProxyEventV2, Callback, Context } from "aws-lambda";
2+
3+
export const handler = (a: APIGatewayProxyEventV2, b: Context, c: Callback) => {
4+
console.log("TODO LIST", JSON.stringify({ MESSAGE: [{ id: 1, text: "TODO 1" }] }));
5+
6+
c(null, {
57
statusCode: 200,
6-
body: JSON.stringify({ MESSAGE:[{ id: 1, text: "TODO 12" }]}),
7-
}
8+
body: JSON.stringify({ MESSAGE: [{ id: 1, text: "TODO 12" }] }),
9+
})
810
}

0 commit comments

Comments
 (0)