Code Monkey home page Code Monkey logo

commandbox-browsersync's Introduction

BrowserSync for CommandBox

BrowserSync will automatically refresh your browser window whenever you save files, allowing for fast, efficient development.

Installation:

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.

Caviat Emptor

  • The npm installs will likely fail if your site is in a dropbox folder or has anything else running that may lock files. If npm fails, shut down any program that is using the site folder while the installs are going on. This part of the process only happens once.
  • If you're on Windows, you should also not run the npm installs "as administrator" unless you're logged in as administrator. The global packages are saved under a user account and will not be available unless you're running everything under that account.
  • If you want us to reinit the framework automatically on core file changes (models, handlers, config, interceptors) you must have a "/healthcheck" route or handler set up. This route is set up by default in /config/router.cfc when using coldbox create app.
/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

commandbox-browsersync's People

Contributors

daemach avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.