introduced the 'mime' config option, addresses #3

This commit is contained in:
Lloyd Brookes
2014-08-24 22:42:59 +01:00
parent c7b6c8da20
commit 3b5a0cac6f
6 changed files with 30 additions and 4 deletions

View File

@ -56,7 +56,7 @@ Server
-p, --port <number> Web server port
-f, --log-format <string> If a format is supplied an access log is written to stdout. If not,
a statistics view is displayed. Use a preset ('none', 'dev',
'default', 'short', 'tiny' or 'logstalgia') or supply a custom format
'combined', 'short', 'tiny' or 'logstalgia') or supply a custom format
(e.g. ':method -> :url').
-d, --directory <string> Root directory, defaults to the current directory
-c, --compress Enables compression
@ -144,6 +144,17 @@ To view your stored defaults, run:
$ ws --config
```
##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:
```json
{
"mime": {
"text/plain": [ "php", "pl" ]
}
}
```
##Use with Logstalgia
local-web-server is compatible with [logstalgia](http://code.google.com/p/logstalgia/).