Ross Coundon
03/14/2021, 10:10 PMnpm init serverless-stack@latest my-sst-app -- --language typescript
I think it’d be a slight improvement for first time users to create a demo function with the signature
export const handler: APIGatewayProxyHandler = async () => {
}
rather than
export async function handler(): Promise<APIGatewayProxyResult> {
}
as that lends itself better for new users to understand what the object event. Maybe something like:
import { APIGatewayProxyHandler } from "aws-lambda";
export const handler: APIGatewayProxyHandler = async (event) => {
return {
statusCode: 200,
body: `Hello world in account ${event.requestContext.accountId}`,
headers: { "Content-Type": "text/plain" },
};
}
Jay
Ross Coundon
03/15/2021, 7:39 AMRoss Coundon
03/15/2021, 7:40 AMJay