Nodemon and NodeJS

0

I'm learning nodejs and would like to know how to add the nodemon so that every time I save the project the same update my webpage.

I installed the nodemon globally and put it in the package.json call

{
  "name": "meuprojeto",
  "version": "0.0.0",
  "private": true,
  "scripts": {
    "start": "nodemon ./bin/www"
  },
  "dependencies": {
    "body-parser": "~1.18.2",
    "cookie-parser": "~1.4.3",
    "debug": "~2.6.9",
    "ejs": "~2.5.7",
    "express": "~4.15.5",
    "morgan": "~1.9.0",
    "serve-favicon": "~2.4.5"
  }
}

But when saving, my web page does not automatically update.

I also tried to run the project directly with the nodemon, entering the folder and typing nodemon .

How do I set it up correctly?

    
asked by anonymous 03.12.2017 / 21:35

1 answer

1

1- install nodemon dev dependencies

npm install nodemon --save-dev

2-configuring start

"scripts": {
    "start": "nodemon seu-arquivo.js"
  },

3-wheeling

npm start

example: link

    
03.12.2017 / 22:32