Skip to content

Commit

Permalink
feat(cli): The --host flag can be run without arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
eirslett committed Apr 21, 2021
1 parent 0c95bf1 commit 04e0264
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion docs/config/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,15 @@ export default async ({ command, mode }) => {
### server.host

- **Type:** `string`
- **Default:** `'127.0.0.1'`

Specify server hostname.
Specify server hostname, used to specify which IP addresses the server
will be available on.
In order to open the server for traffic from other machines, you can
set this to `'0.0.0.0'`.

It is also possible to set this from the CLI using `--host 0.0.0.0`
or just `--host`.

### server.port

Expand Down
2 changes: 1 addition & 1 deletion packages/vite/src/node/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ cli
cli
.command('[root]') // default command
.alias('serve')
.option('--host <host>', `[string] specify hostname`)
.option('--host [host]', `[string] specify hostname`)
.option('--port <port>', `[number] specify port`)
.option('--https', `[boolean] use TLS + HTTP/2`)
.option('--open [path]', `[boolean | string] open browser on startup`)
Expand Down

0 comments on commit 04e0264

Please sign in to comment.