vuejs / vitepress

Vite & Vue powered static site generator.
https://vitepress.dev
MIT License
13.17k stars 2.12k forks source link

default preview or serve not use localhost but log localhost #1867

Closed jchalex closed 1 year ago

jchalex commented 1 year ago

Describe the bug

default preview or serve not use localhost but log localhost

yarn docs:serve

yarn run v1.22.19 $ vitepress serve docs vitepress v1.0.0-alpha.19 Built site served at http://localhost:4173/ <= (actually, not localhost...)

netstat -tnlp | grep 4173

tcp6 0 0 :::4173 :::* LISTEN 3018965/node

Reproduction

vitepress demo

yarn docs:preview
# or
yarn docs:serve

Expected behavior

log for correct host: localhost? 127.0.0.1? 0.0.0.0? ip? Don't mislead me~ T_T

System Info

System:
    OS: Linux 4 CentOS Linux 8
    Memory: 2.72 GB / 3.65 GB
    Container: Yes
    Shell: 4 - /bin/bash
  Binaries:
    Node: 16.17.1 - /usr/local/bin/node
    Yarn: 1.22.19 - /data/app/node-v14.18.1-linux-x64/bin/yarn
    npm: 8.15.0 - /usr/local/bin/npm

Additional context

No response

Validations

kiaking commented 1 year ago

Hmm, good point. Currently, Vite shows http://127.0.0.1 so maybe we should switch to that 👀