Answer the question
In order to leave comments, you need to log in
How to run frontend and backend on gulp with livereload at the same time?
Good day to all.
I write full stack, Angular frontend, Express backend. Everything is standard)))
How can I connect any of the plugins:
gulp-connect, gulp-nodemon, gulp-webserver, browsersync
so that the frontend and backend are on the same port and livereload works?
I connect the frontend via: app.use(express.static('./client'));
and start the server via nodemon:
return nodemon({
script: './server/app.js'
})
Answer the question
In order to leave comments, you need to log in
Nodemon you run with nodemon server/app.js --watch server
browsersync run inside gulpfile with proxy which indicates that above nodemon will run
in gulp task default gulp.watch(['client/*'], browserSync.reload) ;
Should work
There seems to be a livereload middleware for express. But, to be honest, I was always too lazy to figure it out and I just ran gulp watch in one tab, and nodemon app.js in another (tmux is our everything). In production, the static is only collected, so gulp watch is not needed there.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question