Coder Social home page Coder Social logo

Comments (7)

sindresorhus avatar sindresorhus commented on August 19, 2024

See grunt-contrib-livereload

from grunt-contrib-connect.

blai avatar blai commented on August 19, 2024

@sindresorhus I already looked at grunt-contrib-livereload, but I could not get that to work along with socket.io, nor does it support restarting the express/connect server when one of the server script is changed. Or am I missing how that could be done? Are there any examples for restarting server (not refreshing the browser page) using grunt-contrib-livereload? I aim to solve two issues: https://github.com/yeoman/express-stack/issues/7 and https://github.com/yeoman/express-stack/issues/15

from grunt-contrib-connect.

sindresorhus avatar sindresorhus commented on August 19, 2024

Restarting express is very specific and shouldn't be in a generic task. If you only need to restart express you could create a simple task to do it and have it triggered with grunt-contrib-watch.

from grunt-contrib-connect.

blai avatar blai commented on August 19, 2024

@sindresorhus your suggestion should work for the requirement of restarting express upon changes to server scripts Although grunt-contrib-connect is not ideal for all cases, since setting glob expression to watch files based on path is more cumbersome than automatically watching all active modules in Node.js memory. In practice, this feature is used more in a dev only environment and something "just work" without much config fits better (or at least it seems).
But what about socket.io integration, do you have any example that can make socket.io work with grunt-contrib-connect? I tried a few ways but did not find a solution on any of the routes.

from grunt-contrib-connect.

sindresorhus avatar sindresorhus commented on August 19, 2024

I still don't see why you insist on socket.io when grunt-contrib-livereload will do the same thing?

from grunt-contrib-connect.

blai avatar blai commented on August 19, 2024

@sindresorhus ah... sorry to mix up the two issues. socket.io integration was a separate problem from the live-reloading. The use case is I have an express/socket.io serving from a single server instance, just like the sample shows in http://socket.io/#how-to-use. I tried to set it up so when I run grunt connect, both express and socket.io would be served based on my connect task's configuration. I struggled a few days and still cannot get the socket.io to work. Was hoping you can shed some lights on me.

from grunt-contrib-connect.

sindresorhus avatar sindresorhus commented on August 19, 2024

Sorry, no idea, never used socket.io

from grunt-contrib-connect.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.