Serving at http://mbp.local:8000, http://127.0.0.1:8000, http://192.168.0.100:8000
Serving at http://mbp.local:8000, http://127.0.0.1:8000, http://192.168.0.100:8000
```
```
### HTTPS
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.
```sh
$ ws --https
Serving at https://mbp.local:8000, https://127.0.0.1:8000, https://192.168.0.100:8000
```
### HTTP2
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.
```sh
$ ws --http2
Serving at https://mbp.local:8000, https://127.0.0.1:8000, https://192.168.0.100:8000
```
### Mock responses
### Mock responses
Imagine the network is down or you're working offline, proxied requests to `https://internal-service.local/api/users/1` would fail. In this case, Mock Responses can fill the gap. Mocks are defined in a module which can be reused between projects.
Imagine the network is down or you're working offline, proxied requests to `https://internal-service.local/api/users/1` would fail. In this case, Mock Responses can fill the gap. Mocks are defined in a module which can be reused between projects.
A `GET` to `/users` should return our mock user data, including the record just added.
```sh
$ curl http://127.0.0.1:8000/users
[
{
"id": 1,
"name": "Lloyd",
"age": 40
},
{
"id": 2,
"name": "Mona",
"age": 34
},
{
"id": 3,
"name": "Francesco",
"age": 24
},
{
"id": 4,
"name": "Anthony"
}
```
See [the tutorials](https://github.com/lwsjs/local-web-server/wiki#tutorials) for more information and examples about mock responses.
See [the tutorials](https://github.com/lwsjs/local-web-server/wiki#tutorials) for more information and examples about mock responses.
### HTTPS
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.
```sh
$ ws --https
Serving at https://mbp.local:8000, https://127.0.0.1:8000, https://192.168.0.100:8000
```
### HTTP2
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.
```sh
$ ws --http2
Serving at https://mbp.local:8000, https://127.0.0.1:8000, https://192.168.0.100:8000
```
## Further Documentation
## Further Documentation
[See the wiki for plenty more documentation and tutorials](https://github.com/lwsjs/local-web-server/wiki).
[See the wiki for plenty more documentation and tutorials](https://github.com/lwsjs/local-web-server/wiki).