Last active
April 20, 2021 19:34
-
-
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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