课程: Databases for Node.js Developers (2021)
今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
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…
内容
-
-
-
-
-
-
(已锁定)
Introduction to key-value stores5 分钟 10 秒
-
(已锁定)
Set up Redis2 分钟 43 秒
-
(已锁定)
Use Node.js with Redis9 分钟 45 秒
-
(已锁定)
Add Redis to your project5 分钟 57 秒
-
(已锁定)
Session management in Express3 分钟 33 秒
-
(已锁定)
Add Redis sessions to your project4 分钟 27 秒
-
(已锁定)
Implement a basket service6 分钟 23 秒
-
(已锁定)
Add the basket to the page9 分钟 28 秒
-
(已锁定)
-
-