How to open a create-react-app from another computer connected to the same network?

前端 未结 10 579
旧时难觅i
旧时难觅i 2021-02-02 06:38

I am using create-react-app and hosting in its default port localhost:3000 and want to access this from another device on the same net

10条回答
  •  死守一世寂寞
    2021-02-02 07:24

    Simply run HOST=0.0.0.0 npm run start.
    Afterwards open the url from another device on the network.

    In your case, 192.168.0.5:3000 would work.

    Documentation for setting HOST environment variables.

提交回复
热议问题