Command Line Nodemon

Issue

Originally, I was developing my backend for my project, but now I want to start developing the front-end so I put all my documents for my backend into a folder called "server". However, I used to run the application using nodemon index.js but because it is in a folder now, this won’t run. I am not sure how to access it and make it run.

The folder structure is below:
Application
|— Server(folder)
|– index.js
|– package.json

In VScode, my terminal is the following

[email protected] Project-Application--main % 

Solution

update the command with new path

nodemon Server/index.js

if you want nodemon to restart if only files change in Server folder,
create a nodemon.json in the same folder as package.json

{
  "watch": [
    "Server/"
  ]
}

Answered By – linusw

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published