Our system needs some sort of functionality to store the possible clients or just contact persons of other companies. For this, we are going to create a contact schema that will represent the same collection storing all the contacts in MongoDB. We are going to keep our contact schema simple. Let's create a model file in contact-manager/app/models/contact.js, which will hold the schema, and add the following code to it:
Now, we'll start implementing the contact CRUD operations. We'll begin by creating our controller. Create a new file, contact-manager/app/controllers/contact.js, and add the following code:
The main entry point for our application is the server.js file. Create it in the root of the project. This file starts the web server and bootstraps all of the logic. Add the following lines of code:
'use strict';
// Get process environment or set default environment to development