Skip to content

Commit 75cf703

Browse files
authored
feat: Improve the HTTP API typescript example (serverless#709)
1 parent e052c4b commit 75cf703

File tree

3 files changed

+5126
-15
lines changed

3 files changed

+5126
-15
lines changed
Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
1-
import { Handler } from 'aws-lambda';
1+
import { APIGatewayProxyEvent, APIGatewayProxyResult } from "aws-lambda";
22

3-
export const hello: Handler = (event: any) => {
4-
const response = {
3+
export const hello = async (
4+
event: APIGatewayProxyEvent
5+
): Promise<APIGatewayProxyResult> => {
6+
return {
57
statusCode: 200,
68
body: JSON.stringify(
79
{
8-
message: 'Go Serverless v3.0! Your function executed successfully!',
10+
message: "Go Serverless v3.0! Your function executed successfully!",
911
input: event,
1012
},
1113
null,
1214
2
1315
),
1416
};
15-
16-
return new Promise((resolve) => {
17-
resolve(response)
18-
})
19-
}
17+
};

0 commit comments

Comments
 (0)