We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e052c4b commit 75cf703Copy full SHA for 75cf703
aws-node-http-api-typescript/handler.ts
@@ -1,19 +1,17 @@
1
-import { Handler } from 'aws-lambda';
+import { APIGatewayProxyEvent, APIGatewayProxyResult } from "aws-lambda";
2
3
-export const hello: Handler = (event: any) => {
4
- const response = {
+export const hello = async (
+ event: APIGatewayProxyEvent
5
+): Promise<APIGatewayProxyResult> => {
6
+ return {
7
statusCode: 200,
8
body: JSON.stringify(
9
{
- message: 'Go Serverless v3.0! Your function executed successfully!',
10
+ message: "Go Serverless v3.0! Your function executed successfully!",
11
input: event,
12
},
13
null,
14
15
),
16
};
-
- return new Promise((resolve) => {
17
- resolve(response)
18
- })
19
-}
+};
0 commit comments