Skip to content

Commit

Permalink
docs(configuration): update devServer.headers (#5598)
Browse files Browse the repository at this point in the history
* docs(configuration): update `devServer.headers`

* docs(configuration): update `devServer.headers`
  • Loading branch information
snitin315 committed Oct 21, 2021
1 parent dcf403d commit 735ed82
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion src/content/configuration/dev-server.mdx
Expand Up @@ -635,7 +635,7 @@ W> Don't specify `https.ca` and `https.cacert` options together, if specified `h

## devServer.headers

`function` `object`
`array` `function` `object`

Adds headers to all responses:

Expand All @@ -652,6 +652,28 @@ module.exports = {
};
```

You can also pass an array:

**webpack.config.js**

```javascript
module.exports = {
//...
devServer: {
headers: [
{
key: 'X-Custom',
value: 'foo',
},
{
key: 'Y-Custom',
value: 'bar',
},
],
},
};
```

You can also pass a function:

```javascript
Expand Down

1 comment on commit 735ed82

@vercel
Copy link

@vercel vercel bot commented on 735ed82 Oct 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.