Skip to content

Commit 3139339

Browse files
committedJun 7, 2019
docs
1 parent 5f7f450 commit 3139339

File tree

3 files changed

+43
-70
lines changed

3 files changed

+43
-70
lines changed
 

‎README.md

+21-20
Original file line numberDiff line numberDiff line change
@@ -9,35 +9,36 @@
99

1010
# local-web-server
1111

12-
The modular web server for productive full-stack development.
12+
A modular HTTP, HTTPS and HTTP2 command-line web server for productive full-stack development. Local-web-server is a distribution of [lws](https://github.com/lwsjs/lws) bundled with a "starter pack" of useful middleware.
1313

1414
Use this tool to:
1515

16-
* Build any flavour of web application (static site, dynamic site with client or server-rendered content, Single Page App, Progessive Web App, Angular or React app etc.)
17-
* Prototype any CORS-enabled back-end service (e.g. RESTful HTTP API or Microservice using websockets, Server Sent Events etc.)
18-
* Monitor activity, analyse performance, experiment with caching strategies etc.
19-
* Build your own, personalised CLI web server tool
16+
* Help build any flavour of front-end web application
17+
* *Static site, dynamic site with client or server-rendered content, Single Page App, Progessive Web App, Angular or React app etc.*
18+
* Prototype a CORS-enabled back-end service
19+
* *RESTful HTTP API, microservice, websocket server, Server Sent Events service etc.*
20+
* Monitor activity, analyse performance, fine-tune caching strategy etc.
2021

2122
Features:
2223

23-
* Modular, extensible and easy to personalise. Create, share and consume only plugins which match your requirements.
24-
* Powerful, extensible command-line interface (add your own commands and options)
25-
* HTTP, HTTPS and HTTP2 support (HTTP2 requires node v8.4.0 or above)
26-
* URL Rewriting to local or remote destinations
27-
* Single Page Application support
28-
* Response mocking
24+
* Full control over the middleware stack
25+
* Single Page Application (SPA) support
26+
* URL Rewriting
27+
* Proxy requests to remote resources
28+
* HTTP Conditional Request support
29+
* Range request support
30+
* Gzip response compression
31+
* HTTP Basic Authentication
2932
* Configurable access log
30-
* Route blacklisting
31-
* HTTP Conditional and Range request support
32-
* Gzip response compression, HTTP Basic Authentication and much more
33+
* Route blacklisting and more
3334

3435
## Synopsis
3536

3637
This package installs the `ws` command-line tool (take a look at the [usage guide](https://github.com/lwsjs/local-web-server/wiki/CLI-usage)).
3738

3839
### Static web site
3940

40-
The most simple use case is to run `ws` without any arguments - this will **host the current directory as a static web site**. Navigating to the server will render a directory listing or your `index.html`, if that file exists.
41+
Running `ws` without any arguments will host the current directory as a static web site. Navigating to the server will render a directory listing or your `index.html`, if that file exists.
4142

4243
```sh
4344
$ ws
@@ -53,15 +54,15 @@ $ ws --spa index.html
5354
Serving at http://mbp.local:8000, http://127.0.0.1:8000, http://192.168.0.100:8000
5455
```
5556

56-
By default, requests for typical SPA paths (e.g. `/user/1`, `/login`) return `404 Not Found` as a file at that location does not exist. By marking `index.html` as the SPA you create this rule:
57+
With a static site, requests for typical SPA paths (e.g. `/user/1`, `/login`) would return `404 Not Found` as a file at that location does not exist. However, by marking `index.html` as the SPA you create this rule:
5758

5859
*If a static file is requested (e.g. `/css/style.css`) then serve it, if not (e.g. `/login`) then serve the specified SPA and handle the route client-side.*
5960

60-
[Read more](https://github.com/lwsjs/local-web-server/wiki/How-to-serve-a-Single-Page-Application-(SPA)).
61+
[SPA tutorial](https://github.com/lwsjs/local-web-server/wiki/How-to-serve-a-Single-Page-Application-(SPA)).
6162

6263
### URL rewriting and proxied requests
6364

64-
Another common use case is to **re-route certain requests to a remote server** if, for example, you'd like to use data from a different environment. The following command would proxy requests with a URL beginning with `http://127.0.0.1:8000/api/` to `https://internal-service.local/api/`:
65+
Another common use case is to forward certain requests to a remote server. The following command would proxy requests from any URL beginning with `/api/` to `https://internal-service.local/api/`. For example, a request to `/api/posts/1` would be proxied to `https://internal-service.local/api/posts/1`.
6566

6667
```sh
6768
$ ws --rewrite '/api/* -> https://internal-service.local/api/$1'
@@ -70,7 +71,7 @@ Serving at http://mbp.local:8000, http://127.0.0.1:8000, http://192.168.0.100:80
7071

7172
### HTTPS
7273

73-
Launching a secure server is as simple as setting the `--https` flag. [See the wiki](https://github.com/lwsjs/local-web-server/wiki) for further configuration options and a guide on how to get the "green padlock" in your browser.
74+
Launch a secure server by setting the `--https` flag. [See the wiki](https://github.com/lwsjs/local-web-server/wiki) for further configuration options and a guide on how to get the "green padlock" in your browser.
7475

7576
```sh
7677
$ ws --https
@@ -79,7 +80,7 @@ Serving at https://mbp.local:8000, https://127.0.0.1:8000, https://192.168.0.100
7980

8081
### HTTP2
8182

82-
Uses node's built-in HTTP2 support. HTTP2 servers are always secure using local-web-server's built-in SSL certificates (by default) or those supplied by `--cert`, `--key` or `--pfx`. [See the wiki](https://github.com/lwsjs/local-web-server/wiki) for further info about HTTPS options and a guide on how to get the "green padlock" in your browser.
83+
Uses node's built-in HTTP2 support. [See the wiki](https://github.com/lwsjs/local-web-server/wiki) for further info about HTTPS options and a guide on how to get the "green padlock" in your browser.
8384

8485
```sh
8586
$ ws --http2

‎package-lock.json

+19-47
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"index.js"
4040
],
4141
"dependencies": {
42-
"lws": "2.0.0-9",
42+
"lws": "2.0.0-10",
4343
"lws-basic-auth": "^1.0.2",
4444
"lws-blacklist": "^2.0.1",
4545
"lws-body-parser": "^1.0.1",
@@ -48,11 +48,11 @@
4848
"lws-cors": "^2.0.0",
4949
"lws-index": "^1.0.2",
5050
"lws-json": "^1.0.0",
51-
"lws-log": "^1.0.0",
51+
"lws-log": "^1.0.1",
5252
"lws-mime": "^1.0.0",
5353
"lws-range": "^2.0.0",
5454
"lws-request-monitor": "^1.0.3",
55-
"lws-rewrite": "^2.0.0",
55+
"lws-rewrite": "^2.0.1",
5656
"lws-spa": "^2.0.0",
5757
"lws-static": "^1.1.0",
5858
"node-version-matches": "^1.0.1"

0 commit comments

Comments
 (0)
Please sign in to comment.