Express.js is, in the words of the developers, a "fast, unopinionated, minimalist web framework for Node.js."
Designed to be minimal and flexible, Express offers a set of features for creating web and mobile applications. From HTTP methods to built-in middleware, Express is designed to provide you with the features you need to build a web or mobile app on Node.js.
If you want to build an app on Node.js Express is a great choice, whether you use vanilla Express or one of the many frameworks either based on Express or built on top of Express. A few of these frameworks can be found here.
Express generator is a great tool for getting a project up and rolling quickly. Once you understand the organization it implements, it's a real time saver.
All of the examples can be run in node. Simply copy and paste into a node project with Express installed and run them with node filename. For an example of how to install express click here and ensure you have npm installed then follow the instructions on installing packages to install "express."
A middleware function is a function with access to the request object (req), the response object (res), and the next() middleware function in the application's request-response cycle. The next() middleware function is commonly denoted by a variable named next.
Middleware functions are designed to perform the following tasks:
Note: It doesn't have to be named next. But if you use something else no one will know what you mean and you will be fired. And your code won't work. So, just name it next. This rule applies to the request and response object. Some people will use request and response instead of req and res, respectively. That's fine. It wastes keystrokes, but it's fine.
morgan
is an HTTP request logger middleware for node.js
install ejs using the following(I know it's obvious)
sudo npm install ejs --save