Last active
February 8, 2020 21:21
-
-
Save arianacosta/76c58473c5b266a1c361548b87b4bd6f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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