Dev server with BrowserSync support
andrefmsilva opened this issue · comments
Hi there, i'm using your seed with mongodb and i just have a small question (I'm new in web dev so please expect some newbie questions)
Basically i just want to know if it is possible to use BrowserSync for server and client at same time...probably you added a new express instance to avoid more changes in the structure of the original seed project.
Right now i have 2 extra npm commands:
...
"fullstack.server.dev": "gulp build.dev --color --config-env dev && node app.server.dev",
"fullstack.server.prod": "gulp build.dev --color --config-env prod && node app.server.prod",
...
but i want to use BrowserSync to run the dev server, maybe you can add some commented 'browser-sync' override to project.config.ts.
anyway, do you know how can i add browsersync support to your express server instance?
@Zasuk , hello! Sorry for late response. I can propose you very simple good solution with PM2
daemon.
Please look here, you can configure any source changes to restart you backend
: http://pm2.keymetrics.io/docs/usage/watch-and-restart/
Thanks!
Hi, thanks for the help :)
i've tested and it reloads the server. The problem is that i need to spend to much time to see the changes because i have to run the build.dev again and then reload the browser.
i work with two monitores and BrowserSync is awesome because i'm coding in one monitor and then i just need to look to the other one to see the changes almost in real time...
you think that is possible to use browser sync for both?
@Zasuk , yeah, sure it's possible. I will add 2 new npm tasks
for this feature one when I will have a time.
@vyakymenko thanks, that is exactly what i need :)
btw, you have an ideia what files we need to change for that? just asking because i really need this and i want to try to implement it myself.
@vyakymenko using browsersync with proxy for localhost:9001 seems to work.
@Zasuk , great! So we can close this issue ?