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

Added connect-livereload snippet #14

Merged
merged 1 commit into from
Nov 20, 2013

Conversation

jeef3
Copy link
Contributor

@jeef3 jeef3 commented Nov 20, 2013

This removes the need for installing LiveReload as a plug-in.

You could optionally pass in — and check for — a LIVERELOAD_PORT env in much the same way as PORT.

@DaftMonk
Copy link
Member

Nice! This is a really useful change.

DaftMonk added a commit that referenced this pull request Nov 20, 2013
feat(app): Added connect-livereload snippet that removes need for LiveReload plug-in.
@DaftMonk DaftMonk merged commit 56332de into angular-fullstack:master Nov 20, 2013
@jeef3 jeef3 deleted the connect-livereload branch November 20, 2013 20:28
@jeef3
Copy link
Contributor Author

jeef3 commented Nov 20, 2013

I actually use it like:

var livereloadPort = process.env.LIVERELOAD_PORT;

if (livereloadPort) {
  app.use(require('connect-livereload')({ port: livereloadPort }));
}

And then in my Gruntfile.js (I'm using grunt-nodemon)

nodemon: {
  options: {
    env: {
      PORT: APP_PORT,
      LIVERELOAD_PORT: LIVERELOAD_PORT
    }
  }
}

I would have added something like that to this PR, but wasn't sure how you would like to handle the port.

@DaftMonk
Copy link
Member

That's interesting, and I suppose that would make it more configurable from the Gruntfile. I'm just not sure if that level of configuration would be needed for most projects. If you can think of some specific uses cases for setting up the ports that way maybe we can change it.

@jeef3
Copy link
Contributor Author

jeef3 commented Nov 20, 2013

Agreed, most projects will be fine, hence not including it in this PR. The only use case I ran into was when I had LiveReload Sublime plug-in and running, it was conflicting with that port. I just leave this here as a note for the future perhaps 😄

@DaftMonk
Copy link
Member

Well, it's something to consider for the future. Thanks for the PR!

@nwinkler
Copy link
Contributor

Brilliant addition - great! Works like a charm!

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

Successfully merging this pull request may close these issues.

3 participants