From the course: Databases for Node.js Developers

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Add Redis sessions to your project

Add Redis sessions to your project

From the course: Databases for Node.js Developers

Start my 1-month free trial

Add Redis sessions to your project

- [Instructor] After all this talking, now let's get ready to add redis sessions to our application, and for that already opened our app.js file, because this is where all the session management is configured. Then first have to install a model for that. And this module is called connect redis. So now type NPM install connect dash redis. After that I start the application again within NPM run Def, and now right after the session was required I add const redis store. So this is the redis session store equals require connect dash redis. And now very important is argument now. So in parentheses, I add the session object. So this is what the register needs to parametrize itself. And then I scroll down to the middleware in line 19 where the session is configured, and there I can now simply add, store, because this session middleware is really very pluggable. There can now simply pass in the redis store, and now that's very…

Contents