How to setup livereload in mean stack application using grunt?

178 Views Asked by At

Is it possible to set up grunt task which would run the node.js server (nodemon) and enable livereload on other files (html, js, css, assets)?

I know of several options with grunt-contrib-connect or with grunt-express but none of them works with started node.js server. The problem is that aforementioned packages create its own web server but I just want to connect to my already running node.js server.

I was searching for the solution but I have not found one. Is there some way how to do it? Does somebody have reference to some example?

1

There are 1 best solutions below

2
theaccordance On

You could try requiring your server file and associating it to a custom task:

var Server = require('path/to/server');

grunt.registerTask('server', Server);