Skip to content

Commit

Permalink
docs(config): add allowedHosts to dev-server docs (#1294)
Browse files Browse the repository at this point in the history
  • Loading branch information
orteth01 authored and skipjack committed Jun 15, 2017
1 parent 468124d commit 603dd5c
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions content/configuration/dev-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ contributors:
- skipjack
- spacek33z
- charlespwd
- orteth01
---

webpack-dev-server can be used to quickly develop an application. See the ["How to Develop?"](/guides/development) to get started.
Expand Down Expand Up @@ -46,6 +47,34 @@ W> Be aware that when [exporting multiple configurations](/configuration/configu
T> If you're having trouble, navigating to the `/webpack-dev-server` route will show where files are served. For example, `http://localhost:9000/webpack-dev-server`.


## `devServer.allowedHosts`

`array`

This option allows you to specify a whitelist of hosts that are allowed to access the dev server.

```js
allowedHosts: [
'host.com',
'subdomain.host.com',
'subdomain2.host.com',
'host2.com'
]
```

Mimicking django's `ALLOWED_HOSTS`, a value beginning with `.` can be used as a subdomain wildcard. `.host.com` will match `host.com`, `www.host.com`, and any other subdomain of `host.com`.

```js
// this achieves the same effect as the first example
// with the bonus of not having to update your config
// if new subdomains need to access the dev server
allowedHosts: [
'.host.com',
'host2.com'
]
```


## `devServer.clientLogLevel`

`string`
Expand Down

0 comments on commit 603dd5c

Please sign in to comment.