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

Question: how can I run Nodejs server and elm-live on the same port #86

Closed
Neats29 opened this issue Nov 30, 2016 · 2 comments
Closed

Comments

@Neats29
Copy link

Neats29 commented Nov 30, 2016

Many thanks for making this helpful package. I had a question.

I have a Nodejs backend that is serving a html file compiled from Elm. I have the server running on one port and elm-live running on another port successfully, but what I'd like is to be able to run both on the same port. At the moment when I try this, I have to refresh the page to see the elm changes. How can I achieve this?

Thanks

@tomek-he-him
Copy link
Collaborator

Hey man, good question!

So technically, elm-live takes two ports to work – one for serving static files, another with a LiveReload server pushing info about updates to the browser. The static HTML file gets a JS snippet injected via inject-lr-script. That’s how the browser gets the heads up that it’s time to reload.

At the moment the port at which LiveReload is being served is hidden away in the internals. What springs to my mind is to expose a --livereload-port=PORT option where you can set that port yourself. And with control over that, you can take care of serving the snippet yourself. Does that sound good?

@wking-io
Copy link
Owner

No activity in 2 years if you still have this problem please open a new issue

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

No branches or pull requests

3 participants