From the course: Databases for Node.js Developers
Unlock this course with a free trial
Join today to access over 25,600 courses taught by industry experts.
Basic Redis operations for shopping baskets, part 2 - Node.js Tutorial
From the course: Databases for Node.js Developers
Basic Redis operations for shopping baskets, part 2
- [Instructor] In our current implementations, users can add things to the basket, but this does not reflect in the UI anywhere. But actually we already have the infrastructure in place to show the basket count, but right now we are not populating this specific variable. When I look into my Visual Studio Code and I go into views and there into layout, and look for basket, you will see that we are looking for a variable called basketCount. And if it's there, we show even a link to the basket. So what we need to do now is we have to somewhere add functionality to populate this central basket in our application. And for that, we will now create our own basket plugin. So now after extending the plugins, now finally you can write your own one. And for that, in plugins, I create the new file and then call it basket.js. In there I will now import, and this is now Fastify-specific. So we need to input the plugin function from fastify-plugin, it's fp, and then we can start writing the plugin…
Contents
-
-
-
-
-
-
-
(Locked)
Fast and flexible basket and session management with Redis2m 3s
-
(Locked)
Setting up Redis with Docker1m 37s
-
(Locked)
Exploring Redis with Redis Insight2m 36s
-
(Locked)
Connecting our application to Redis4m 35s
-
(Locked)
Managing user sessions with Redis8m 50s
-
(Locked)
Basic Redis operations for shopping baskets, part 111m 16s
-
(Locked)
Basic Redis operations for shopping baskets, part 27m 47s
-
(Locked)
-
-