Skip to content

Commit

Permalink
Ensuring --host option changes the network host
Browse files Browse the repository at this point in the history
Fixes #12865
  • Loading branch information
ryanml committed Dec 27, 2020
1 parent c661af3 commit a03d4e2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/core/src/server/dev-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,8 @@ export async function storybookDevServer(options: any) {

const { port, host } = options;
const proto = options.https ? 'https' : 'http';
const address = `${proto}://${host || 'localhost'}:${port}/`;
const networkAddress = `${proto}://${ip.address()}:${port}/`;
const address = `${proto}://localhost:${port}/`;
const networkAddress = `${proto}://${host || ip.address()}:${port}/`;

await new Promise((resolve, reject) => {
// FIXME: Following line doesn't match TypeScript signature at all 🤔
Expand Down Expand Up @@ -414,7 +414,7 @@ export async function storybookDevServer(options: any) {
]);

// TODO #13083 Remove this when compiling the preview is fast enough
if (!options.ci) openInBrowser(address);
if (!options.ci) openInBrowser(networkAddress);

return { ...previewResult, ...managerResult, address, networkAddress };
}

0 comments on commit a03d4e2

Please sign in to comment.