BoxLang 🚀 A New JVM Dynamic Language Learn More...
BrowserSync will automatically refresh your browser window whenever you save files, allowing for fast, efficient development.
Install browsersync using commandbox:
install commandbox-browsersync
This tool requires nodejs, (unfortunately). Once you install that, cd to your site root and:
browsersync [ proxyPort = random ] [ fwreinit = true ]
browsersync 4500 false (proxy port will be 4500, no fwreinit)
proxyPort ( default: random ) and fwreinit ( default: true ) are both optional.
If the npm dependencies don't exist we'll attempt to install them for you.
/config/router.cfc
=============
route("/healthcheck",function(event,rc,prc){
return "Ok!";
});
The tool can launch your commandbox server if it's not already running and will create a nodejs browsersync proxy at your commandbox server port + 1, if that port is available, or another random port if not. Any changes to files in your layouts, views, handlers or models folders will cause the browser to reload.
Browsersync also has a UI that lets you configure its behavior, including the ability to throttle bandwidth so you can simulate slow links (from mobile devices, for example) You should be able to reach it at http://localhost:3001
$
box install commandbox-browsersync