Skip to content

Commit

Permalink
Find a new port if the specified --port is taken
Browse files Browse the repository at this point in the history
  • Loading branch information
ahuth committed Jul 23, 2024
1 parent cfe4a0e commit 2eac166
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ async function getServer(options: Options): Promise<Server> {
await waitRandomTime(500);

const localPath = getStaticStorybookPath(options);
const port = options.port || (await portfinder.getPortPromise());
const port = await portfinder.getPortPromise({port: options.port});
const host = '127.0.0.1';
const server = httpServer.createServer({root: localPath});
const storybookUrl = `http://${host}:${port}`;
Expand Down

0 comments on commit 2eac166

Please sign in to comment.