You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+20-19
Original file line number
Diff line number
Diff line change
@@ -19,19 +19,6 @@ Use this tool to:
19
19
**RESTful HTTP API, microservice, websocket server, Server Sent Events service etc.*
20
20
* Monitor activity, analyse performance, fine-tune caching strategy etc.
21
21
22
-
Features:
23
-
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
32
-
* Configurable access log
33
-
* Route blacklisting and more
34
-
35
22
Local-web-server is a distribution of [lws](https://github.com/lwsjs/lws) bundled with a "starter pack" of useful middleware.
36
23
37
24
## Synopsis
@@ -56,7 +43,6 @@ Serving a Single Page Application (an app with client-side routing, e.g. a React
56
43
57
44
```sh
58
45
$ ws --spa index.html
59
-
Serving at http://mbp.local:8000, http://127.0.0.1:8000, http://192.168.0.100:8000
60
46
```
61
47
62
48
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:
@@ -67,13 +53,16 @@ With a static site, requests for typical SPA paths (e.g. `/user/1`, `/login`) wo
67
53
68
54
### URL rewriting and proxied requests
69
55
70
-
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`.
56
+
Another common use case is to forward certain requests to a remote server.
57
+
58
+
The following command proxies blog post requests from any path beginning with `/posts/` to `https://jsonplaceholder.typicode.com/posts/`. For example, a request for `/posts/1` would be proxied to `https://jsonplaceholder.typicode.com/posts/1`.
0 commit comments