Skip to content

Commit

Permalink
fix: use localhost instead of 127.0.0.1 (umijs#8367)
Browse files Browse the repository at this point in the history
  • Loading branch information
sorrycc authored Jul 4, 2022
1 parent 171a5d7 commit 194ed86
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/bundler-vite/src/server/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export async function createServer(opts: IOpts) {
});
}

const host = process.env.HOST || '127.0.0.1';
const host = process.env.HOST || 'localhost';

logger.ready(`Example app listening at ${protocol}//${host}:${port}`);
});
Expand Down
2 changes: 1 addition & 1 deletion packages/bundler-webpack/src/server/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ export async function createServer(opts: IOpts) {
const port = opts.port || 8000;

server.listen(port, () => {
const host = opts.host && opts.host !== '0.0.0.0' ? opts.host : '127.0.0.1';
const host = opts.host && opts.host !== '0.0.0.0' ? opts.host : 'localhost';
logger.ready(
`App listening at ${chalk.green(`${protocol}//${host}:${port}`)}`,
);
Expand Down
2 changes: 1 addition & 1 deletion packages/preset-umi/src/commands/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ umi preview --port [port]
const host =
api.args.host && api.args.host !== '0.0.0.0'
? api.args.host
: '127.0.0.1';
: 'localhost';

logger.ready(
`App listening at ${chalk.green(`${protocol}//${host}:${port}`)}`,
Expand Down

0 comments on commit 194ed86

Please sign in to comment.