Storybook: devServer options not used by server

Created on 14 Dec 2016  Â·  2Comments  Â·  Source: storybookjs/storybook

I'm specifying some devServer options in Storybook's webpack config:

 Object.assign(storybookBaseConfig, {
    devServer: {
      headers: { 'Access-Control-Allow-Origin': '*' }
    }
  });

When running the storybook server, the headers are not included:

➜  component-library git:(master) ✗ curl -v http://localhost:6006/                                                                     09:57:18
*   Trying ::1...
* Connected to localhost (::1) port 6006 (#0)
> GET / HTTP/1.1
> Host: localhost:6006
> User-Agent: curl/7.49.1
> Accept: */*
>
< HTTP/1.1 200 OK
< X-Powered-By: Express
< Content-Type: text/html; charset=utf-8
< Content-Length: 1228
< ETag: W/"4cc-bRBT7YfeEe5YUtIAIwEt+w"
< Date: Wed, 14 Dec 2016 08:57:29 GMT
< Connection: keep-alive
<

    <!DOCTYPE html>
feature request

Most helpful comment

Is there any documentation on how to use the feature closed with the #723 pull request?

All 2 comments

We are using the webpack-dev-middleware.
I am happy to expose an way to get config for this.
I suggest to use a config field called devMiddlewareOptions.

Here's related place you should look at it: https://github.com/storybooks/react-storybook/blob/master/src/server/middleware.js#L24

We are open for PRs.

Is there any documentation on how to use the feature closed with the #723 pull request?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wahengchang picture wahengchang  Â·  3Comments

rpersaud picture rpersaud  Â·  3Comments

ZigGreen picture ZigGreen  Â·  3Comments

sakulstra picture sakulstra  Â·  3Comments

levithomason picture levithomason  Â·  3Comments