Skip to content

Instantly share code, notes, and snippets.

@canac
Created September 12, 2016 14:00
Show Gist options
  • Select an option

  • Save canac/fdf05d727e62830ef767f3114986ca2e to your computer and use it in GitHub Desktop.

Select an option

Save canac/fdf05d727e62830ef767f3114986ca2e to your computer and use it in GitHub Desktop.
Live-reloading static server
require('livereload').createServer().watch(__dirname);
const file = new (require('node-static').Server)('.');
require('http').createServer((req, res) =>
req.addListener('end', () => file.serve(req, res)).resume()
).listen(8080);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment