feat: allow different host through CLI flag (#1475)

* feat(core): use 0.0.0.0 for livereload address

* test(core): update server tests

* feat(cli): add host by command line flag

* test: revert test changes

* fix(core): update server to use custom host if supplied

* refactor: nits
This commit is contained in:
Cole 2019-05-20 09:31:41 -07:00 committed by Endi
parent 382b88bb49
commit 0568ad4992
6 changed files with 13 additions and 8 deletions

View file

@ -146,6 +146,7 @@ This command will build the static website, apply translations if necessary, and
| Options | Default | Description |
| ----------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `--port <number>` | `3000` | The website will be served from port 3000 by default, but if the port is taken up, Docusaurus will attempt to find an available one. |
|`--host <host>`|`localhost`|Specify a host to use. E.g., if you want your server to be accessible externally, you can use --host 0.0.0.0.|
| `--watch` | - | Whether to watch the files and live reload the page when files are changed. Defaults to true. Disable this by using `--no-watch`. |
You can specify the browser application to be opened by setting the `BROWSER` environment variable before the command, e.g.: