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
| import { APIGatewayProxyCallback, APIGatewayProxyEvent, APIGatewayProxyResult, Context, } from 'aws-lambda'; import { makeResponse } from './makeResponse'; import { service } from './service';
export const handler = async ( _e: APIGatewayProxyEvent, _c: Context, callback: APIGatewayProxyCallback ): Promise<APIGatewayProxyResult | undefined> => { let response;
try { const res = await service(); response = makeResponse(200, res); } catch (err) { console.error(err); callback(err as any); }
return response; };
|