In this video, learn how to add parameters to a route. First, get an introduction to the concepts, and then learn how to do it in code with parameters that pull data from our mock JSON database.
- [Narrator] We already briefly introduced methods…used for doing specific actions on your web server…such as using get, post, put, and delete.…Along with these methods, you can specify the path…to which these methods can be performed.…Like our own path, forward slash, which is our home path…and our new item for the post method.…So these paths could be anything you want…for your clients to call into, but what about parameters.…What are they and how would they be used?…So let's say for example,…you have a Mongo collection containing users…and you need to pull a specific user that you'd like…to render on a page along with its details.…
What about if you had a collection of movies like Netflix…and would like to pull the details for a specific movie?…This is where parameters come handy.…And they are very simple.…Let me demonstrate.…Go back into VS Code and inside of the index.js file.…What we'll do is use the get method to create a new path.…So let's go ahead and just return on line 16 here…and do app, dot, get...…
- Creating a basic data endpoint
- Routing with Express
- Adding a static route for file serving
- Basic middleware with Express
- Built-in middleware and error-handling middleware
- Debugging in an Express application
- Security best practices with Express
Skill Level Beginner
Building RESTful Web APIs with Node.js and Expresswith Emmanuel Henri1h 40m Intermediate
1. Setting Up Express
2. Getting Started
3. Routing with Express
4. Middleware with Express
5. Advanced Topics in Express
- 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.