API Register

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
API result after running the command
API result using Postman




Finalist student in Computer Engineering

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

⚛ Slow Reaction ⚛

My Boss Didn’t Want to Hire Front-End Developer Because We Could Use Website Builders

Javascript Splice —  Js Array method

Extraction And Reusability Of Common Yup Methods In React

How to display Tableau dashboards on web pages

Weather (날씨) — Let’s learn Korean phrases!

The tech stack powering Boxy 2, one of the most successful web wrappers for the Mac

How to convert your Text into AudioBook using JavaScript

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Afonso Antunes

Afonso Antunes

Finalist student in Computer Engineering

More from Medium

Let’s Create your first REST API with KoaJS

Fixed the error : Support for password authentication was removed on <Date>.

Express Js basic setup

Postman API 101