gulp-community / gulp-livereload

gulp plugin for livereload
768 stars 67 forks source link

Static Server Example not working #49

Closed jordanpapaleo closed 9 years ago

jordanpapaleo commented 9 years ago

Hello -

I am trying to use gulp-livereload with a static server and I am not able to accomplish that. I have a site setup in my HOSTS file served via Nginx. I would like to use livereload to refresh my site when I make changes.

I am having problems with the server gulp task. It requires connect (btw: it is not listed as a dependency on your npm site). So I installed it: npm install connect I am assuming that this is the connect git repo https://github.com/senchalabs/connect. When I execute the server task I get an error basically saying that connect "has no 'static' method".

Questions:

  1. Can I use live reload with nginx?
  2. If yes, can someone take a look at the server task and see what should be happening when I execute server.use(connect.static(dest)).listen(process.env.PORT || 80, next)

Thanks,

Jordan

cyrusdavid commented 9 years ago
  1. Yes. Just point it to wherever your source files are built (e.g. a dist folder)
  2. If you would like to use nginx, then don't add a server task. See basic usage.

Let me know if you still have a problem.