Created
August 5, 2016 16:44
-
-
Save daliborgogic/69bde9122e864683818f79490cb9d5ae to your computer and use it in GitHub Desktop.
Get User by Email
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
app.route('/v1/users/:email') | |
// GET https://api.example.com/v1/users/:email | |
.get((req, res) => { | |
User.find({ email: req.params.email}, (err, user) => { | |
if (err) throw err | |
res.json(user) | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment