Creating contact endpoints and controller actions

Now that we have our model, our database connection, our router, and a logger setup, we can start to write the business logic for our application. This will mainly consist of different controller actions, to handle CRUD operations for the contacts in our database.

We will start by creating a ContactController.js file in the controllers folder, as follows:

touch controllers/ContactController.js

Next, we can define the different route actions in our controller.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.129.210.17