learning path

Express - Level 2

Intermediate
1h 28m
50
Enhance your skill setDevelop essential skills for thriving in real-world scenarios.
Stay focused, stay committedBoost your learning journey by enrolling: stay focused, consistent and achieve your goals with ease.
Earn a certificate of completionShow your skills and build your credibility when you include them in your resume and LinkedIn profile.

This course covers some of the more advanced topics with Express. In this path, you will learn how to implement route and query parameters. How to use two specialized route methods, route and all. How to implement environment variables using the DotEnv NPM package. You will learn about the potential issue when working with static files and how to manage them. How to implement custom middleware when needed. How to use Express Router to implement modular routes.


Learning Objectives


  • Explain the query parameter
  • Learn how to implement a query parameter
  • Understand the req.query object
  • Learn how to access the query parameter from the req.query object
  • Learn the structure of a route to reject invalid query parameters
  • Explain the route parameter
  • Learn how to implement a route parameter
  • Understand the req.params object
  • Learn how to access the route parameter from the req.params object
  • Learn the structure of a route to accept multiple route parameters
  • Understand how the app.all() route handler works to handle all HTTP request methods
  • Implement app.all()
  • Understand how the app.route() method works to create chainable route methods
  • Implement app.route()
  • Install dotenv package
  • Implement a .env file
  • Learn what dotfiles are in general
  • Import the dotenv package inside of an Express package
  • Use environment variables inside of the Express package
  • Implement a views route to serve a static HTML file
  • Implement the response object’s sendFile method to send an HTML file
  • View common errors when dealing with static files and learn how to handle them
  • Implement the path.join method to create the absolute path to a file
  • Understand the process variable __dirname
  • Implement the express.static middleware to create a virtual path
  • Learn what middleware is and how it fits in the request/response cycle
  • Learn how to implement custom middleware
  • Learn about the next function and how it facilitates custom middleware
  • Learn to use custom middleware in different ways to work with your routes
  • Learn what happens when you do not include the next function as part of your middleware
  • Understand how the app.all() route handler works to handle all HTTP request methods
  • Implement app.all()
  • Understand how the app.route() method works to create chainable route methods
  • Implement app.route()
  • Understand how express.Router() is used to create a router instance
  • Learn how to refactor and organize resource-specific route paths into router instances
  • Learn how to configure a router instance as middleware 
  • Learn how the route path is configured when using router instances as middleware


Your certificate for this learning path

About the Author

Avatar
Farish Kashefinejad, opens in a new tab
Full-Stack Development Content Creator
Students
10,189
Labs
24
Courses
87
Learning paths
34

Farish has worked in the EdTech industry for over six years. He is passionate about teaching valuable coding skills to help individuals and enterprises succeed.

Previously, Farish worked at 2U Inc in two concurrent roles. Farish worked as an adjunct instructor for 2U’s full-stack boot camps at UCLA and UCR. Farish also worked as a curriculum engineer for multiple full-stack boot camp programs. As a curriculum engineer, Farish’s role was to create activities, projects, and lesson plans taught in the boot camps used by over 50 University partners. Along with these duties, Farish also created nearly 80 videos for the full-stack blended online program.

Before 2U, Farish worked at Codecademy for over four years, both as a content creator and part of the curriculum experience team.

Farish is an avid powerlifter, sushi lover, and occasional Funko collector.

Covered Topics