Unit 2 Overview
In the previous unit, we explored the fundamentals of Express.js, including routing, the request-response cycle, and an introduction to middleware and templating with EJS. This unit builds upon those concepts by diving deeper into router parameters and creating middleware that interacts with the request (req) and response (res) objects.
Additionally, we will examine HTTP status codes, their importance, and how to use them effectively in web applications. We will also introduce the Model-View-Controller (MVC) architecture, a design pattern that promotes scalability and maintainability in your applications. By the end of this unit, you will be equipped to develop more professional, efficient, and robust server-side rendered web applications.
Part 1
Complete the following in the specified order by the due dates listed in Canvas or before the end of the unit if no date is listed:
-
HTTP Status Codes
Discover the purpose of HTTP status codes and how they reveal the success or failure of web requests, including common status' like200,404, and500. -
Error Handling
Learn how to handle errors in your Express.js applications. This includes understanding the different types of errors, how to catch them, and how to respond appropriately to ensure a smooth user experience. -
Basic Error Handling (404 and 500)
Implement basic error handling in your Express.js application, including handling 404 and 500 errors. This will help you provide a better user experience by displaying appropriate error messages when something goes wrong. -
Route Parameters (Request Parameters)
Explore how to use route parameters to extract values from the URL and pass them dynamically into your application, enabling more flexible and interactive routing -
Intro to Route Parameters (Request Parameters)
Learn how to use route parameters to capture values in the URL and use them in your application. This will allow you to create dynamic routes that can handle different inputs and provide more flexibility in your application. -
Middleware Revisited
Dive deeper into middleware in Express.js, learning about the different types of middleware, how they work, and how to use them effectively in your applications. -
Intro to Middleware
Understand the concept of middleware in Express.js and how to create and use middleware functions. Middleware functions are essential for handling various tasks such as logging, authentication, and error handling in your application.
Part 2
Complete the following in the specified order by the due dates listed in Canvas or before the end of the unit if no date is listed:
-
Intro to MVC
Learn the fundamentals of MVC architecture, which organizes applications into three distinct components. This structure promotes a separation of concerns, enhancing scalability, reusability, and collaboration. -
Refactoring with MVC
Refactor your existing site to implement the Model-View-Controller (MVC) architecture. This will involve restructuring your application to separate concerns, improving maintainability, scalability, and readability. -
Code Review
Participate in a code review session where you will review your peers' code and provide constructive feedback. This is an important part of the development process that helps improve code quality and fosters collaboration among developers. -
Coding Challenge: Faculty Features
Put your knowledge into practice with a hands-on coding challenge. You'll demonstrate your ability to implement Express.js routing, middleware, error handling, and the MVC pattern by building a functional application that integrates these concepts.