By default, typical SPA urls (e.g. `/user/1`, `/login`) would return `404 Not Found` as there is no file at that location on disk. By marking `index.html` as the SPA you create this rule:
By default, typical SPA urls (e.g. `/user/1`, `/login`) would return `404 Not Found` as there is no file at that location on disk. 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.*
*if a static file at the requested path exists (e.g. `/css/style.css`) then serve it, if it does not (e.g. `/login`) then serve the SPA.*
### Access Control
### Access Control
Access to all files is allowed, beside those you forbid (e.g. config files):
Access to all files is allowed, beside those in the forbidden list (e.g. config files):
```sh
```sh
$ ws --forbid .json .yml
$ ws --forbid .json .yml
serving at http://localhost:8000
serving at http://localhost:8000
@ -54,6 +54,8 @@ When urls don't map to your directory structure, rewrite:
By default, typical SPA urls (e.g. `/user/1`, `/login`) would return `404 Not Found` as there is no file at that location on disk. By marking `index.html` as the SPA you create this rule:
By default, typical SPA urls (e.g. `/user/1`, `/login`) would return `404 Not Found` as there is no file at that location on disk. 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.*
*if a static file at the requested path exists (e.g. `/css/style.css`) then serve it, if it does not (e.g. `/login`) then serve the SPA.*
### Access Control
### Access Control
Access to all files is allowed, beside those you forbid (e.g. config files):
Access to all files is allowed, beside those in the forbidden list (e.g. config files):
```sh
```sh
$ ws --forbid .json .yml
$ ws --forbid .json .yml
serving at http://localhost:8000
serving at http://localhost:8000
@ -54,6 +54,8 @@ When urls don't map to your directory structure, rewrite:
description:"If a format is supplied an access log is written to stdout. If not, a statistics view is displayed. Use a preset ('none', 'dev','combined', 'short', 'tiny' or 'logstalgia') or supply a custom format (e.g. ':method -> :url').",group:'server'
description:"If a format is supplied an access log is written to stdout. If not, a statistics view is displayed. Use a preset ('none', 'dev','combined', 'short', 'tiny' or 'logstalgia') or supply a custom format (e.g. ':method -> :url').",group:'server'