Skip to content

Instantly share code, notes, and snippets.

@arianacosta
Last active February 8, 2020 21:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arianacosta/76c58473c5b266a1c361548b87b4bd6f to your computer and use it in GitHub Desktop.
Save arianacosta/76c58473c5b266a1c361548b87b4bd6f to your computer and use it in GitHub Desktop.
export interface GetGreetingRequest {
firstName: string;
lastName: string;
isFormal: boolean;
}
export interface GetGreetingResponse {
greeting: string;
}
export const handler = async (event: GetGreetingRequest): Promise<GetGreetingResponse> => {
const greeting = event.isFormal ?
`Dear ${event.firstName} ${event.lastName}, welcome back.` :
`Hey ${event.firstName} ${event.lastName}! Long time no see.`;
return {
greeting,
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment