grunt-express-server with contrib-watch

后端 未结 1 1721
[愿得一人]
[愿得一人] 2021-01-06 19:00

I am trying to use both grunt-express-server and grunt-contrib-watch however, as soon as my express server starts, it no longer seems to do any wat

相关标签:
1条回答
  • 2021-01-06 20:03

    I was able to clone your project and able to get everything running with the following tweak in server.js:

    app.listen(3000);
    

    into:

    app.listen(3000, function() {
      console.log('Server listening on port 3000');
    });
    

    According to the grunt-express-server's "Usage" docs, your server should console.log some output so that the grunt task can tell that the server has started successfully.

    (This is because starting the server is asynchronous, which can cause a race-condition with LiveReload)

    Otherwise, there is a delay option for purists who don't want any output from their application :)

    0 讨论(0)
提交回复
热议问题