Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not a proper issue...but how do you auto refresh browser upon file changes? #102

Open
paxperscientiam opened this issue Nov 23, 2015 · 1 comment

Comments

@paxperscientiam
Copy link

Hi uicferrier! First off, thank you for the awesome elnode.

I'm a big fan of emacs and emacs lisps, though I still have much to learn. It's continually exciting to see how extensible emacs really is.

I'm trying to wrap my mind around elnode. One thing in particular that I'm having trouble figuring out is how to auto-refresh the browser (when served files and directories change) with elnode alone (that is, without using additional tools).

Actually, a command would work nicely too when paired with 'firestarter.'

I know that many authors on github don't like "how to" questions, so please do pardon the faux pas.

@preetpalS
Copy link

I did not pinpoint how this is done in elnode, but one way to implement this is to inject code (JavaScript) in the client side browser to reload the page when there are filesystem changes. The injected client side code maintains contact (through web sockets or polling) with the server so that it stays informed of any changes on the filesystem. The server either is watching for changes in the filesystem either through polling (constantly checking filesystem on an interval) or through filesystem change events if available (for example via kqueue on FreeBSD). See livereload-js for an example of client side code and middleman-livereload for an example of a corresponding server side implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants