Skip to main content

Exercise: Express and MySQL

Objective#

Your objective is to create routes for CRUD operations on our bestbuy database for products.

Steps#

Exercise 1: Routes for Products#

We 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.

  1. Create controllers, findOne, findAll, addOne, updateOne, and removeOne, for working with product data from the bestbuy database
  2. Create routes, GET, POST, PUT, and DELETE, that will use these controllers and response with the appropriate data
  3. Test your work

Helpful Links#

If you feel stuck, or would like to see the finished code for this exercise to check your work, check out: