- 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 initThis will take basic information for our required project like name, author, git link etc while creating
package.jasonfile. All the information that you provide here will be there inpackage.jsonfile.
Open the CMD and go to your project folder locatoin then execute below commands,
-
To install required paKages
npm install mongoose --savenpm install express --savenpm 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.jsornodemonIf you start you application using
nodemonthere 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 usersto execute. It'll do so.To Get out of executiuon press
ctrl+Cand inputy -> ENTER.