@ -10,13 +10,31 @@ A simple web-server for productive front-end development.
**Requires node v4.0.0 or higher**.
**Requires node v4.0.0 or higher**.
## Synopsis
## Synopsis
Some typical use cases..
Serve a directory on the default port:
### Static site
Fire up your site on the default port:
```sh
```sh
$ tree
.
├── css
│ └── style.css
└── index.html
$ ws
$ ws
serving at http://localhost:8000
serving at http://localhost:8000
```
```
### Single Page Application
Mark `index.html` as an SPA with client-side routing.
```sh
$ ws --spa index.html
```
With this option, routes with existing files (e.g. `/css/style.css`) will be served normally as static assets. Routes without an existing file (e.g. `/user/1`, `/login` etc.) are passed directly to your SPA. Without this option they would 404.
Blacklist certain paths, for example config files:
Blacklist certain paths, for example config files:
```sh
```sh
$ ws --forbid .json .yml
$ ws --forbid .json .yml
@ -28,11 +46,17 @@ Reduce bandwidth with gzip compression:
$ ws --compress
$ ws --compress
```
```
Specify a Single Page Application:
When urls don't map to your directory structure, rewrite:
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`.
@ -116,6 +140,9 @@ You can set additional mime-type/extension mappings, or override the defaults by
}
}
```
```
## Use with Google DevTools Workspaces
## Log Visualisation
## 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).
Instructions for how to visualise log output using goaccess, logstalgia or gltail [here](https://github.com/75lb/local-web-server/wiki/Log-visualisation).
@ -10,13 +10,31 @@ A simple web-server for productive front-end development.
**Requires node v4.0.0 or higher**.
**Requires node v4.0.0 or higher**.
## Synopsis
## Synopsis
Some typical use cases..
Serve a directory on the default port:
### Static site
Fire up your site on the default port:
```sh
```sh
$ tree
.
├── css
│ └── style.css
└── index.html
$ ws
$ ws
serving at http://localhost:8000
serving at http://localhost:8000
```
```
### Single Page Application
Mark `index.html` as an SPA with client-side routing.
```sh
$ ws --spa index.html
```
With this option, routes with existing files (e.g. `/css/style.css`) will be served normally as static assets. Routes without an existing file (e.g. `/user/1`, `/login` etc.) are passed directly to your SPA. Without this option they would 404.
Blacklist certain paths, for example config files:
Blacklist certain paths, for example config files:
```sh
```sh
$ ws --forbid .json .yml
$ ws --forbid .json .yml
@ -28,11 +46,17 @@ Reduce bandwidth with gzip compression:
$ ws --compress
$ ws --compress
```
```
Specify a Single Page Application:
When urls don't map to your directory structure, rewrite:
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`.
@ -116,6 +140,9 @@ You can set additional mime-type/extension mappings, or override the defaults by
}
}
```
```
## Use with Google DevTools Workspaces
## Log Visualisation
## 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).
Instructions for how to visualise log output using goaccess, logstalgia or gltail [here](https://github.com/75lb/local-web-server/wiki/Log-visualisation).