@ -35,9 +35,9 @@ You're building a web app with client-side routing, so mark `index.html` as the
$ ws --spa index.html
$ ws --spa index.html
```
```
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 a file does not exist with that path. By marking `index.html` as the SPA you create this rule:
*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.*
*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 for client-side processing.*
### Access Control
### Access Control
@ -54,8 +54,6 @@ 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 dynamic 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'
},
},
{
{
name:'directory',alias:'d',type:String,
name:'directory',alias:'d',type:String,
@ -34,15 +34,15 @@ module.exports = {
},
},
{
{
name:'config',type:Boolean,
name:'config',type:Boolean,
description:'Print the stored config',group:'misc'
description:'Print the config found in [underline]{package.json} and/or [underline]{.local-web-server}',group:'misc'
}
}
],
],
usageData:{
usageData:{
title:'local-web-server',
title:'local-web-server',
description:'Lightweight static web server, zero configuration.',
description:'A simple web-server for productive front-end development.',