Introduction to the Express Framework

Опубликовано: 12 Август 2026
на канале: MBCode
30
0

Server-side development with Express. Introduction to the Express framework. Here's the MEAN stack. In this section, we'll explore the Express.js framework of the MEAN stack. Express.js is represented by this letter E in the MEAN stack is an open source Node.js web application framework. If you think about it, it is really just another Node module that provides a robust set of features for Node applications. It also has a plethora of HTTP utility methods and middleware functions for us to use to interact with the request response cycle. Now because Express.js is the de facto framework for Node, many other frameworks actually built on it. Here is four examples of such frameworks. LoopBack, for example, is an API development. Sails it's an MVC framework for Node. NestJS it's a progressive Node framework for building apps on top of a task-driven JavaScript. Feathers it's another framework for real-time apps and the rest APIs creations, and there are many others which I don't list it here. But let's take a look at this Node.js processing model. Again, you've seen this many times throughout the course and you're going to see it again throughout this course and many other web UNM courses. I want to focus on this blue square here. This is where an Express.js framework lives. It sits on top of this Node.js HTTP server. Really it expands the HTTP module to provide all business logics, things like route and routers and web services and database models in connectivities and many other middleware which we'll explore in a separate video. Express.js provides us with this MVC, Model-View-Controller paradigm. With it, we can use it to take advantage of this model. Now, when a request comes to the server, we can use a templated system such as pug, ejs or hbs, or handlebars to create and manage the view, to write a business logic in the controller where the source lives and store all the model or data separately in another module. We'll use modules such as Mongoose to work with MongoDB and so on. When data comes back and then it goes back out to the view like so. Now we have a complete separate of concerns or SOC using this MVC model where our code will be more efficiently maintained and managed. That's what Express gives us. Now in the next video, we'll install the latest version of Express.js and use it to create a simple HTTP server to serve in Node.js application.