课程: Databases for Node.js Developers (2021)

今天就学习课程吧!

今天就开通帐号,24,700 门业界名师课程任您挑!

Implement a basket service

Implement a basket service

- [Instructor] Any shop needs a shopping cart or basket for users to actually buy something. And we also need some page like here in shop, that lists all the items that are in the catalog. In preparation for this video, I already created three items in my item management so that we have something to buy. And let's start now with the shop page so that we get a list of items. For that, I head into Visual Studio Code, and in server, routes, shop, index.js. We see that again, a lot of stuff is commented out. So now, we'll remove return statement and the comments from this first route we have here for the index of the page. And you see that we are missing the item service now and I can not simply bring it in but const ItemService equals require and it's two levels up services/ItemService. You see I have the application still running with nodemon, so I can now just head over to the browser, and let's now click on shop,…

内容