node

Pattern Lab ships with BrowserSync to serve generated files to a browser. BrowserSync does a lot of cool things like reload files without a refresh, expose the site to your network, and synchronize page views across devices. To start the server do the following:

  1. In a terminal window navigate to the root of your project
  2. Type gulp patternlab:serve

If using grunt, substitute grunt for gulp above.

Doing so will launch your local Pattern Lab install in your default browser at http://localhost:3000. The Gruntfile|Gulpfile at the root of your project contains additional configuration for BrowserSync.

How to Stop the Server

To stop watching and serving files on Mac OS X and Windows you can pressCTRL+C in the command line window where the process is running.

php

Pattern Lab utilizes PHP's [built-in web server](http://php.net/manual/en/features.commandline.webserver.php) to let you browse your generated patterns. To start the server do the following:

1. In a terminal window navigate to the root of your project
2. Type `php core/console --server`

Your local Pattern Lab install should now be available for browsing at [http://localhost:8080](http://localhost:8080).