Implement Route Handlers for GET, PUT, and DELETE
Implement more route handlers in our application.
Let’s allow the API consumer to retrieve, update, or delete a recipe by ID. Don’t forget to test the endpoint with Postman!
Implementing route handlers
Let’s make sure that our files contain the following code.
- First, implement the necessary functions in the service layer to perform CRUD operations on the database. Add the following code in the
express-recipes/src/services/recipes.js
file:
Get hands-on with 1400+ tech skills courses.