Created
July 13, 2017 16:46
-
-
Save harrylincoln/4134690a4888b622b7da8526a19f39f7 to your computer and use it in GitHub Desktop.
/api routes and the authentication handled by the brilliant express-firebase-middleware
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
... | |
router.use('/api', cors(), firebaseMiddleware.auth); | |
router.get('/api/hello', (req, res) => { | |
res.json({ | |
message: `You're logged in as ${res.locals.user.email} with Firebase UID: ${res.locals.user.uid}` | |
}); | |
}); | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment