课程: Databases for Node.js Developers (2021)
今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Add Redis to your project
- [Instructor] In our shopping application, we are going to use redis to implement first sessions and then also the shopping basket. But before we can do all that, we have to first bring in redis and configure it. So for that, please make sure that you are in the shopper directory again. And here, I now run NPM install ioredis. And to set up redis and to establish the connection, we will again, use serverbinstartJS and there I will first, after mongoose add const redis=requireioredis. Next, I switch really quick into the config file, and here in indexJS, I will now add a new property, redis aftermongoDB, because we also want to configure redis. And in our case, we first just need the port, and the port is 7379. So that's the port of our docker container. And I also add one more property, that's client, and it should be null. And this will make sense to you really soon. First, I head back now to startJS, and in there, I…
内容
-
-
-
-
-
-
(已锁定)
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 秒
-
(已锁定)
-
-