- Developed As Demo Project to Learn NodeJs with MongoDB, Express, Mongoose
-
create a directory with your desired project name using command
mkdir demoApp1
-
switch to that folder using
cd demoApp1
-
execute command
npm init
This will take basic information for our required project like name, author, git link etc while creating
package.jason
file. All the information that you provide here will be there inpackage.json
file.
Open the CMD
and go to your project folder locatoin then execute below commands,
-
To install required paKages
npm install mongoose --save
npm install express --save
npm install body-parser --save
-
For execution of our project on Save Changes install nodemon using command,
npm install nodeman -g
-
To Run this Project first time (your default entry file app.js or index.js)
node app.js
ornodemon
If you start you application using
nodemon
there no need to rerun project using command, when you save your changes it'll automatically restart it. Else if you want to restart using terminal users
to execute. It'll do so.To Get out of executiuon press
ctrl+C
and inputy -> ENTER
.