Full-Stack Web Development with Vue.js and Node

(singke) #1
Introducing REST APIs Chapter 4

The _id is the Mongo ID of the user, which is sent by Mongoose query by default, and we


are fetching the name and email of the user. If we want the names only, we can change our
query in the users controller to fetch only the name.


Postman lets us edit the endpoints and requests are easy to develop. If we want to use our
own local browser to test, we can do that as well.


I have used a Chrome plugin called JSONview to format the JSON response. You can get
the plugin from here:
https:/​/​chrome.​google.​com/​webstore/​detail/​jsonview/


chklaanhfefbnpoihckbnefhakgolnmc.

Free download pdf