Forever node.js - directory for viewing file changes

I want my node application to index.jsrestart if any file change is found in its directory or below. In addition, I want the process to be in the foreground, outputting the logs to the terminal. What is a team?

My attempts:

forever stopall

forever -w /home/patrick/workspace/frontend-api/index.js

Result:

warn:    --minUptime not set. Defaulting to: 1000ms
warn:    --spinSleepTime not set. Your script will exit if it does not stay up for at least 1000ms
error: Could not read .foreverignore file.
error: ENOENT, open '/.foreverignore'
error: restarting script because unlinkDir changed

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: watch EACCES
    at errnoException (fs.js:1024:11)
    at FSWatcher.start (fs.js:1056:11)
    at Object.fs.watch (fs.js:1081:11)
+4
source share
2 answers

it looks like you need nodemon

npm install -g nodemon

however on my windows server i used https://github.com/tjanczuk/iisnodefor scalability on multicore servers

+3
source

, ( , ). -w --watch .foreverignore, , , .

.foreverignore , . , , - , , .

, :

:

/apps/myapp/.foreverignore

node_modules/*
logs/*
conf/*
htdocs/*
*.log
*.gif
*.jpg
*.html

, , .

+1
source

Source: https://habr.com/ru/post/1612416/


All Articles