Installing additional middleware

As you can see in the previous sections, we used some middleware to display messages and the user icon using the gravatar. In this section, we will see how to install some very important modules for our application.

Since we created templates for the signin, signup, and profile pages, we will need to store the users with login and password.

These are the middleware that we will use for this task, with the definition for each one:

Component

Description

More details

connect-flash

User-friendly messages

https://www.npmjs.com/package/connect-flash

connect-mongo

Drive to connect with MongoDB

https://www.npmjs.com/package/connect-mongo

express-session

Store user sessions in the DB

https://www.npmjs.com/package/express-session ...

Get Node.js 6.x Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.