Skip to content

Instantly share code, notes, and snippets.

@tianhaoz95
Last active January 15, 2020 23:31
Show Gist options
  • Save tianhaoz95/9555c8ab0e8ed0acfcbb65d640331167 to your computer and use it in GitHub Desktop.
Save tianhaoz95/9555c8ab0e8ed0acfcbb65d640331167 to your computer and use it in GitHub Desktop.
The handler for unified Firebase APIs
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