Ensure [node.js](http://nodejs.org) is installed first. Linux/Mac users may need to run the following commands with `sudo`.
Ensure [node.js](http://nodejs.org) is installed first. Linux/Mac users may need to run the following commands with `sudo`.
###Globally
###Globally
```sh
```sh
$ npm install -g local-web-server
$ npm install -g local-web-server
```
```
###Bundled with your project
###Bundled with your project
```sh
```sh
$ npm install local-web-server --save-dev
$ npm install local-web-server --save-dev
```
```
@ -45,7 +45,7 @@ $ npm install
$ npm start
$ npm start
```
```
##Usage
##Usage
```
```
Usage
Usage
$ ws <serveroptions>
$ ws <serveroptions>
@ -90,7 +90,7 @@ To add compression, reducing bandwidth, increasing page load time (by 10-15% on
$ ws --compress
$ ws --compress
```
```
###Logging
###Logging
Passing a value to `--log-format` will write an access log to `stdout`.
Passing a value to `--log-format` will write an access log to `stdout`.
Either use a built-in [morgan](https://github.com/expressjs/morgan) logger preset:
Either use a built-in [morgan](https://github.com/expressjs/morgan) logger preset:
@ -108,7 +108,7 @@ Or silence:
$ ws -f none
$ ws -f none
```
```
##Storing default options
##Storing default options
To store per-project options, saving you the hassle of inputting them everytime, store them in the `local-web-server` property of your project's `package.json`:
To store per-project options, saving you the hassle of inputting them everytime, store them in the `local-web-server` property of your project's `package.json`:
```json
```json
{
{
@ -144,7 +144,7 @@ To view your stored defaults, run:
$ ws --config
$ ws --config
```
```
##mime-types
##mime-types
You can set additional mime-type/extension mappings, or override the defaults by setting a `mime` value in your local config. This value is passed directly to [mime.define()](https://github.com/broofa/node-mime#mimedefine). Example:
You can set additional mime-type/extension mappings, or override the defaults by setting a `mime` value in your local config. This value is passed directly to [mime.define()](https://github.com/broofa/node-mime#mimedefine). Example:
```json
```json
@ -155,10 +155,10 @@ You can set additional mime-type/extension mappings, or override the defaults by
}
}
```
```
##Use with Logstalgia
##Use with Logstalgia
local-web-server is compatible with [logstalgia](http://code.google.com/p/logstalgia/).
local-web-server is compatible with [logstalgia](http://code.google.com/p/logstalgia/).
###Install Logstalgia
###Install Logstalgia
On MacOSX, install with [homebrew](http://brew.sh):
On MacOSX, install with [homebrew](http://brew.sh):