3.1.1 • Published 7 years ago

buddy-server v3.1.1

Weekly downloads
22
License
MIT
Repository
github
Last release
7 years ago

NPM Version

buddy-server

A simple development fileserver, with LiveReload support, for the buddy build tool.

WARNING: default fileserving is very permissive! This is inherently insecure, and therefore only recommended for local development.

When working with the LiveReload feature, it is recommended to install the LiveReload Chrome extension, or include the following in your html source to initiate the connection:

<script src="http://localhost:35729/livereload.js"></script>

Usage

{
  "devDependencies": {
    "buddy": "6.13.0",
    "buddy-server": "3.0.0"
  },
  "buddy": {
    "server": {
      "port": 8000,
      "directory": "www"
    }
  }
$ buddy watch --serve --reload

Specify multiple directories:

"buddy": {
  "server": {
    "port": 8000,
    "directory": ["www", "assets"]
  }
}

Configure headers to pass to the default static file server:

"buddy": {
  "server": {
    "port": 8000,
    "directory": "www",
    "headers": {
      "x-foo": "foo"
    }
  }
}

Specify an alternative root url from which to serve source maps:

"buddy": {
  "server": {
    "port": 8000,
    "directory": "www",
    "sourceroot": "https://raw.githubusercontent.com/user/repo/master/"
  }
}

Custom application server

To use a custom application server instead of the default, specify a file path to your server:

"buddy": {
  "server": {
    "port": 8000,
    "file": "./index.js"
  }
}

Configure environment variables with env:

"buddy": {
  "server": {
    "port": 8000,
    "file": "./index.js",
    "env": {
      "DEBUG": "*"
    }
  }
}

Configure flags to pass to the Node process running your server:

"buddy": {
  "server": {
    "port": 8000,
    "file": "./index.js",
    "flags": ['--inspect']
  }
}

NOTE The current port number will be exposed as process.env.PORT.

3.1.1

7 years ago

4.0.0-beta-1

7 years ago

3.1.0

7 years ago

3.0.0

7 years ago

2.1.0

7 years ago

2.0.3

7 years ago

2.0.2

8 years ago

2.0.1

8 years ago

2.0.0

8 years ago

1.0.1

8 years ago

1.0.0

9 years ago

0.4.4

10 years ago

0.4.3

10 years ago

0.4.2

11 years ago

0.4.1

11 years ago

0.4.0

11 years ago

0.3.0

11 years ago

0.2.0

11 years ago