diff --git a/README.md b/README.md index 63ce800..6612a20 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,10 @@ clean up all the inter-module references, and without a whole new If "error", an exit code of 0 will still restart. If "exit", no restart regardless of exit code. + -t|--non-interactive + Dissable interactive capacity + With this option, supervisor won't listen to stdin + --force-watch Use fs.watch instead of fs.watchFile. This may be useful if you see a high cpu load on a windows machine. @@ -69,10 +73,10 @@ clean up all the inter-module references, and without a whole new -q|--quiet Suppress DEBUG messages - - + + Options available after start: - rs - restart process. Useful when you want to restart your program even + rs - restart process. Useful when you want to restart your program even if no file has changed. @@ -84,6 +88,8 @@ clean up all the inter-module references, and without a whole new supervisor -- server.js -h host -p port +In order to not watch for file changes, use "-i .". + ## Simple Install Just run: diff --git a/lib/supervisor.js b/lib/supervisor.js index f7ebc57..8a17d1d 100644 --- a/lib/supervisor.js +++ b/lib/supervisor.js @@ -205,14 +205,17 @@ function run (args) { var watchItems = watch.split(','); watchItems.forEach(function (watchItem) { - watchItem = path.resolve(watchItem); - log("Watching directory '" + watchItem + "' for changes."); - if(interactive) { - log("Press rs for restarting the process."); + watchItem = path.resolve(watchItem); + + if ( ! ignoredPaths[watchItem] ) { + log("Watching directory '" + watchItem + "' for changes."); + if(interactive) { + log("Press rs for restarting the process."); + } + findAllWatchFiles(watchItem, function(f) { + watchGivenFile( f, poll_interval ); + }); } - findAllWatchFiles(watchItem, function(f) { - watchGivenFile( f, poll_interval ); - }); }); }; diff --git a/test/sampleApp/server.js b/test/sampleApp/server.js index 084ab4c..f77e4a7 100755 --- a/test/sampleApp/server.js +++ b/test/sampleApp/server.js @@ -1,4 +1,5 @@ #!/usr/bin/env node + var express = require('express'); var app = express(); @@ -6,13 +7,12 @@ app.get('/', function (req, res) { // // CORS // - res.setHeader("Access-Control-Allow-Origin", "http://cors-client.com"); - res.send('Hello World!') + res.setHeader("Access-Control-Allow-Origin", "*"); + res.send('Hello World!'); }); var server = app.listen(3000, function () { var host = server.address().address; var port = server.address().port; - console.log('Example app listening at http://%s:%s', host, port); });