Skip to content

Instantly share code, notes, and snippets.

@vojtajina
Created December 21, 2013 22:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vojtajina/8076226 to your computer and use it in GitHub Desktop.
Save vojtajina/8076226 to your computer and use it in GitHub Desktop.
var chokidar = require('chokidar');
var watcher = new chokidar.FSWatcher({
usePolling: false,
useFsEvents: true,
// changing to false makes it work
ignoreInitial: true,
});
watcher.add('/Users/vojta/Code/karma/test/e2e/basic');
watcher.on('change', function() {
console.log('change', arguments)
});
// start socket.io server
var io = require('socket.io');
var http = require('http');
var server = http.createServer(function() {});
io.listen(server);
server.listen(8080, function() {
// commenting this out will make it work too
http.get('http://localhost:8080/socket.io/socket.io.js');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment