Skip to content

Instantly share code, notes, and snippets.

@pwfisher
Last active April 20, 2021 19:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pwfisher/6a6a0e0de62649e06141e37749f23fcf to your computer and use it in GitHub Desktop.
Save pwfisher/6a6a0e0de62649e06141e37749f23fcf to your computer and use it in GitHub Desktop.
Ember fastboot-app-server notifier which polls for filesystem events to restart server. Polls to support use within virtual machines (e.g. Vagrant vm dev box with NFS mounted source).
const debounce = require('debounce')
const FastBootAppServer = require('fastboot-app-server')
const Sane = require('sane')
const distPath = '/app/dist'
const server = new FastBootAppServer({
distPath,
notifier: {
subscribe(notify) {
const watcher = new Sane(distPath, { poll: true })
watcher.on('all', debounce(notify, 100))
return Promise.resolve()
},
},
})
server.start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment