Join Alexander Zanfir for an in-depth discussion in this video Create a message list endpoint with Express, part of MEAN Stack and MongoDB: Development Techniques.
- [Voiceover] In this video we will make it possible…to show all of our messages in your web browser…through our web API.…Let's begin by creating a new end point using app.get.…We'll do that above our app.post.…And we'll use the same location as our post,…which is api/message.…So I'll just copy that.…The same location will work because the browser…and our app will know we are requesting a get…instead of a post.…And Node will be able to use the correct route,…as we will see shortly.…
Next let's tell express that we would like to use…our GetMessage function to handle the request…and response.…In order to use GetMessages for that purpose,…we will need to make a few changes to it.…First we need to pass in the request and response.…And so we will need to add them as arguments…in our function.…And finally, instead of outputting the result…to the console, we will be sending it…and the response with response.send…and we'll just pass in the result.…
Now let's remove the test GetMessages call…from our mongoConnect.…And finally we can use our function…
- Installing and setting up your MEAN toolset
- Making an Angular post form
- Sending posts
- Displaying messages
- Creating a registration form
- Saving users
- Associating users with posts
- Authenticating users at login
Skill Level Intermediate
2. Message Posting
3. Display Messages
Save a user with Mongo13m 26s
5. Logging In
Next steps2m 5s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.