In this video, learn how to connect the basket service with your route.
- [Instructor] Now, to add items to the basket…we obviously also need some overview page…that shows the items that are available in the shop.…So for that I already created plenty…of the logic in the sample project.…So let's open server, routes,…and there there's shop and index.js.…But what we have to do is, we just have…to wire in our service methods here.…First of all, we want to add the itemService,…const itemService equals require.…
And we have to go two levels up, services, and itemService.…Then, we also want to bring in the basket service,…const basketService equals require.…And again, two levels up, services, basketService.…Now, as you might remember, basketService,…let's open it again here, service,…basketService, actually exports a function…that takes the client, the redis client in.…
So we have to initiate basketService, actually, here.…So for the down here, after line seven…we add const basket equals basketService.…And we call it with config.redis.client.…Next, we have to remove…all those comments here from these routes.…
- Basics of relational and nonrelational databases
- Preparing your environment
- When to use document databases
- Inserting data into MongoDB
- Basic insert operations for MongoDB
- Querying data from MongoDB with Node.js
- Using key-value stores
- Using relational databases with Node.js
- Adding MySQL and Sequelize to a project
Skill Level Intermediate
Node.js: Build Your First Microservicewith Daniel Khan2h 9m Intermediate
Building a Website with Node.js and Express.jswith Ray Villalobos3h 16m Intermediate
1. Get Started with Databases for Node.js
2. Prepare Your Environment
3. Use Document Databases with Node.js
4. Use Key-Value Stores with Node.js
5. Use Relational Databases with Node.js
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.