Browse Source

docs

master
Lloyd Brookes 9 years ago
parent
commit
b77050fd8d
  1. 53
      README.md
  2. BIN
      doc/img/logstagia.gif
  3. 37
      doc/visualisation.md
  4. 53
      jsdoc2md/README.hbs

53
README.md

@ -121,16 +121,17 @@ serving at http://localhost:8000
[morgan](https://github.com/expressjs/morgan)
### Mock Responses
*Coming soon*.
### Other features
Compression, caching, simple statistics view, log, override mime types.
## Tips
Serve gzip-compressed resources, where applicable
```sh
$ ws --compress
```
### Use with Google DevTools Workspaces
Disable etag-based caching
```sh
$ ws --no-cache
```
### Log Visualisation
Instructions for how to visualise log output using goaccess, logstalgia or gltail [here](https://github.com/75lb/local-web-server/wiki/Log-visualisation).
@ -180,42 +181,6 @@ $ npm start
serving at http://localhost:8100
```
## 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`:
```json
{
"name": "my-project",
"version": "0.11.8",
"local-web-server":{
"port": 8100
}
}
```
Or in a `.local-web-server.json` file stored in the directory you want to serve (typically the root folder of your site):
```json
{
"port": 8100,
"log-format": "tiny"
}
```
Or store global defaults in a `.local-web-server.json` file in your home directory.
```json
{
"port": 3000,
"refresh-rate": 1000
}
```
All stored defaults are overriden by options supplied at the command line.
To view your stored defaults, run:
```sh
$ 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:
@ -248,8 +213,6 @@ const localWebServer = require('local-web-server')
localWebServer().listen(8000)
```
## Composition
* * *
&copy; 2015 Lloyd Brookes <75pound@gmail.com>. Documented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown).

BIN
doc/img/logstagia.gif

After

Width: 700  |  Height: 360  |  Size: 570 KiB

37
doc/visualisation.md

@ -0,0 +1,37 @@
## Goaccess
## Logstalgia
local-web-server is compatible with [logstalgia](http://code.google.com/p/logstalgia/).
### Install Logstalgia
On MacOSX, install with [homebrew](http://brew.sh):
```sh
$ brew install logstalgia
```
Alternatively, [download a release for your system from github](https://github.com/acaudwell/Logstalgia/releases/latest).
Then pipe the `logstalgia` output format directly into logstalgia for real-time visualisation:
```sh
$ ws -f logstalgia | logstalgia -
```
![local-web-server with logstalgia](http://75lb.github.io/local-web-server/logstagia.gif)
## glTail
To use with [glTail](http://www.fudgie.org), write your log to disk using the "default" format:
```sh
$ ws -f default > web.log
```
Then specify this file in your glTail config:
```yaml
servers:
dev:
host: localhost
source: local
files: /Users/Lloyd/Documents/MySite/web.log
parser: apache
color: 0.2, 0.2, 1.0, 1.0
```

53
jsdoc2md/README.hbs

@ -121,16 +121,17 @@ serving at http://localhost:8000
[morgan](https://github.com/expressjs/morgan)
### Mock Responses
*Coming soon*.
### Other features
Compression, caching, simple statistics view, log, override mime types.
## Tips
Serve gzip-compressed resources, where applicable
```sh
$ ws --compress
```
### Use with Google DevTools Workspaces
Disable etag-based caching
```sh
$ ws --no-cache
```
### Log Visualisation
Instructions for how to visualise log output using goaccess, logstalgia or gltail [here](https://github.com/75lb/local-web-server/wiki/Log-visualisation).
@ -180,42 +181,6 @@ $ npm start
serving at http://localhost:8100
```
## 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`:
```json
{
"name": "my-project",
"version": "0.11.8",
"local-web-server":{
"port": 8100
}
}
```
Or in a `.local-web-server.json` file stored in the directory you want to serve (typically the root folder of your site):
```json
{
"port": 8100,
"log-format": "tiny"
}
```
Or store global defaults in a `.local-web-server.json` file in your home directory.
```json
{
"port": 3000,
"refresh-rate": 1000
}
```
All stored defaults are overriden by options supplied at the command line.
To view your stored defaults, run:
```sh
$ 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:
@ -231,8 +196,6 @@ You can set additional mime-type/extension mappings, or override the defaults by
{{>main}}
## Composition
* * *
&copy; 2015 Lloyd Brookes <75pound@gmail.com>. Documented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown).
Loading…
Cancel
Save