-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathsimple.ts
More file actions
31 lines (28 loc) · 1.02 KB
/
Copy pathsimple.ts
File metadata and controls
31 lines (28 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import { APIGatewayEvent, APIGatewayEventRequestContext, APIGatewayProxyResult } from 'aws-lambda';
/**
*
* Event doc: https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-lambda-proxy-integrations.html#api-gateway-simple-proxy-for-lambda-input-format
* @param {APIGatewayEvent} event - API Gateway Lambda Proxy Input Format
*
* Context doc: https://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-context.html
* @param {APIGatewayEventRequestContext} context
*
* Return doc: https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-lambda-proxy-integrations.html
* @returns {APIGatewayProxyResult} object - API Gateway Lambda Proxy Output Format
*
*/
export const handler = async (event: APIGatewayEvent): Promise<APIGatewayProxyResult> => {
let response: APIGatewayProxyResult;
try {
response = {
statusCode: 200,
body: JSON.stringify({
message: 'hello simple world!',
}),
};
} catch (err) {
console.log(err);
return err;
}
return response;
};