feat(v2): add support for serve command (#3080)

* add support for serve command

* add serve to init

* use existing choosePort function

* add --host

* add more docs

* add docs to deployment
This commit is contained in:
Anshul Goyal 2020-07-20 22:30:37 +05:30 committed by GitHub
parent 6a511b805a
commit a51a56ec42
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 134 additions and 5 deletions

View file

@ -111,3 +111,14 @@ Deploys your site with [GitHub Pages](https://pages.github.com/). Check out the
| --- | --- | --- |
| `--out-dir` | `build` | The full path for the new output directory, relative to the current workspace. |
| `--skip-build` | `false` | Deploy website without building it. This may be useful when using custom deploy script. |
### `docusaurus serve`
Serve your built website localy.
| Name | Default | Description |
| --- | --- | --- |
| `--port` | `3000` | Use specified port |
| `--dir` | `build` | The full path for the output directory, relative to the current workspace |
| `--build` | `false` | Build website before serving |
| `--host` | `localhost` | Specify a host to use. For example, if you want your server to be accessible externally, you can use `--host 0.0.0.0`. |