firebase cli serve cant access the project from different device

后端 未结 4 1882
醉酒成梦
醉酒成梦 2021-01-11 13:55

I have install firebase cli etcetc. I can start the project and develop using firebase serve. I can visit the page of the project through localhost:5000 but if i try from di

4条回答
  •  北海茫月
    2021-01-11 14:33

    If you run firebase serve --help, it will give you the information needed to listen on a different port or IP address:

    Usage: serve [options]
    
    start a local server for your static assets
    
    Options:
    
    -p, --port    the port on which to listen (default: 5000) (default: 5000)
    -o, --host    the host on which to listen (default: localhost) (default: localhost)
    --only     only serve specified targets (valid targets are: functions, hosting)
    --except   serve all except specified targets (valid targets are: functions, hosting)
    -h, --help          output usage information
    

    You can use -p and -o on the command line to change the host and port where it listens for connections. For your case, you won't be able use localhost for the host because that's only visible to other processes on the same machine.

提交回复
热议问题