Exercise: Express and MySQL
#
ObjectiveYour objective is to create routes for CRUD operations on our bestbuy database for products.
#
Steps#
Exercise 1: Routes for ProductsWe walked through connecting a mysql database to our express application, but we only created controllers and routes for employees. We'll leave this one exercise to instruct you on how to complete this exercise. There are several steps, but if you get stuck, you can reference our work with the employees data logic.
- Create controllers,
findOne
,findAll
,addOne
,updateOne
, andremoveOne
, for working with product data from the bestbuy database - Create routes, GET, POST, PUT, and DELETE, that will use these controllers and response with the appropriate data
- Test your work
#
Helpful LinksIf you feel stuck, or would like to see the finished code for this exercise to check your work, check out: