@ -10,10 +10,9 @@ 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. For these examples, assume we're in our site directory, which looks like:
Some typical use cases. For these examples, assume we're in a site directory looking like this:
```sh
```sh
$ tree
.
.
├── css
├── css
│ └── style.css
│ └── style.css
@ -36,7 +35,7 @@ You're building a web app with client-side routing, so mark `index.html` as the
$ ws --spa index.html
$ 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.
By default, typical SPA urls (e.g. `/user/1`, `/login`) would return `404 Not Found`. By marking `index.html` as the SPA you create this rule: *if a file with that url exists (e.g. `/css/style.css`) then serve it, if it does not (e.g. `/login`) then pass it to the SPA*.
### Access Control
### Access Control
@ -69,8 +68,6 @@ Always use this port and blacklist? Persist it to the config:
@ -10,10 +10,9 @@ 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. For these examples, assume we're in our site directory, which looks like:
Some typical use cases. For these examples, assume we're in a site directory looking like this:
```sh
```sh
$ tree
.
.
├── css
├── css
│ └── style.css
│ └── style.css
@ -36,7 +35,7 @@ You're building a web app with client-side routing, so mark `index.html` as the
$ ws --spa index.html
$ 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.
By default, typical SPA urls (e.g. `/user/1`, `/login`) would return `404 Not Found`. By marking `index.html` as the SPA you create this rule: *if a file with that url exists (e.g. `/css/style.css`) then serve it, if it does not (e.g. `/login`) then pass it to the SPA*.
### Access Control
### Access Control
@ -69,8 +68,6 @@ Always use this port and blacklist? Persist it to the config: