Skip to content

Instantly share code, notes, and snippets.

@de314
Created January 13, 2018 03:12
Show Gist options
  • Save de314/07652ae8c947b7975b2d1ab8bd4bd5c9 to your computer and use it in GitHub Desktop.
Save de314/07652ae8c947b7975b2d1ab8bd4bd5c9 to your computer and use it in GitHub Desktop.
Start script for browser sync
#!/bin/bash
# You need to globally install broswser-sync `npm i -g browser-sync` and might need to export the node path
# Then you can run `$ bbs` to serve the current directory or `bbs ~/workspace/web/my-project` to specify the base directory
SERVER_DIR=${1:-$PWD}
echo $SERVER_DIR
browser-sync start -s $SERVER_DIR -f $SERVER_DIR --port 3333 --ui-port 3334 --directory --cors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment