I have an file called app.js which uses express.js to serve some content on port 3000. I have manually added livereload.js to the html and the LiveReload object is available in browser console.
This gulpfile reloads the app.js to restart the server but the page in the browser stays the same.
const gulp = require('gulp')
const gls = require('gulp-live-server')
const server = gls('app.js', undefined, 12345)
function restartExpress(cb) {
server.start.bind(server)()
server.notify.apply(server, [cb])
cb()
}
exports.default = function () {
server.start()
gulp.watch(['./**/*', '!node_modules/**/*', '!db/**/*'], function (cb) {
restartExpress(cb)
})
}
I have an file called
app.js
which uses express.js to serve some content on port 3000. I have manually added livereload.js to the html and the LiveReload object is available in browser console. This gulpfile reloads theapp.js
to restart the server but the page in the browser stays the same.Is the method correct or did I miss something?