@ -10,7 +10,7 @@ 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 a site directory looking like this:
For the examples below, assume we're in a project directory looking like this:
```sh
```sh
.
.
@ -35,7 +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`. 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*.
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.*
Instructions for how to visualise log output using goaccess, logstalgia or gltail [here](https://github.com/75lb/local-web-server/wiki/Log-visualisation).
## Install
## Install
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`.
@ -86,16 +105,21 @@ Ensure [node.js](http://nodejs.org) is installed first. Linux/Mac users may need
$ npm install -g local-web-server
$ npm install -g local-web-server
```
```
This will install the `ws` tool globally. To see the available options, run:
```sh
$ ws --help
```
## Distribute with your project
## Distribute with your project
The standard convention with client-server applications is to add an `npm start` command to launch the server component.
The standard convention with client-server applications is to add an `npm start` command to launch the server component.
@ -165,12 +190,6 @@ You can set additional mime-type/extension mappings, or override the defaults by
}
}
```
```
## Use with Google DevTools Workspaces
## 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,7 +10,7 @@ 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 a site directory looking like this:
For the examples below, assume we're in a project directory looking like this:
```sh
```sh
.
.
@ -35,7 +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`. 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*.
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.*
Instructions for how to visualise log output using goaccess, logstalgia or gltail [here](https://github.com/75lb/local-web-server/wiki/Log-visualisation).
## Install
## Install
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`.
@ -86,16 +105,21 @@ Ensure [node.js](http://nodejs.org) is installed first. Linux/Mac users may need
$ npm install -g local-web-server
$ npm install -g local-web-server
```
```
This will install the `ws` tool globally. To see the available options, run:
```sh
$ ws --help
```
## Distribute with your project
## Distribute with your project
The standard convention with client-server applications is to add an `npm start` command to launch the server component.
The standard convention with client-server applications is to add an `npm start` command to launch the server component.
@ -165,16 +190,12 @@ You can set additional mime-type/extension mappings, or override the defaults by
}
}
```
```
## Use with Google DevTools Workspaces
## 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).