API Register

Hi people!!

Today, I will make do a little demonstration about this API.

1st step: Create a directory for the project

mkdir appRegister
cd appRegister

2nd step: Start the project

npm init

3rd step: Installing required packages

npm install --save express body-parser mongoose

4th step: Create the index.js and the MVC Organization

touch index.js
touch registerController.js
touch registerModel.js
touch registerRoutes.js

5th step: Put the following code in the index.js file

index.js file

6th step: Put the following code in the other JS files (MVC Organization)

registerController.js file
registerModel.js file
registerRoutes.js file

7th step: Test the app running the following command…

node index.js

And the results were as follows:

API result after running the command
API result using Postman