Last active
January 15, 2020 23:31
-
-
Save tianhaoz95/9555c8ab0e8ed0acfcbb65d640331167 to your computer and use it in GitHub Desktop.
The handler for unified Firebase APIs
This file contains hidden or 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
| async function awesomeHandler(req: any, context: FunctionContext) { | |
| if (context.authenticated) { | |
| const userUid: string = context.uid; | |
| // Here goes your API implementation | |
| } else { | |
| throw UnauthenticatedUserError; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment