Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase serve from vagrant localhost:5000

I'm running vagrant/ubuntu 16.04 on mac os high sierra. I have set port forwarding and symlink to awesome.local.com. Basic node.js web app works perfectly and can be viewed on mac chrome browser pointing to awesome.local.com:3000

I want to develop firebase in this environment the same way, and was able to set-up the CLI and logged in fine.

Going through the Firebase Web Codelab: https://codelabs.developers.google.com/codelabs/firebase-web/index.html?index=..%2F..%2Findex#0

When running

$ firebase serve

Looks like everything is running without error (I did debug):

hosting: Local server: http://localhost:5000

When I go to the browser and point to awesome.local.com:5000 I get:

This site can’t be reached

awesome.locl.com refused to connect.
Search Google for awesome.local.com:5000
ERR_CONNECTION_REFUSED

I've tried:

  • rebuilt dev environment
  • reinstalling everything
  • other tutorials

Thanks for any help with this.

like image 822
jkpham001 Avatar asked Feb 18 '18 17:02

jkpham001


1 Answers

If you want to run firebase serve against a different host and port, see the help in the CLI:

$ firebase serve --help

Usage: serve [options]

start a local server for your static assets


Options:

  -p, --port <port>   the port on which to listen (default: 5000) (default: 5000)
  -o, --host <host>   the host on which to listen (default: localhost) (default: localhost)
  --only <targets>    only serve specified targets (valid targets are: functions, hosting)
  --except <targets>  serve all except specified targets (valid targets are: functions, hosting)
  -h, --help          output usage information

You can change the host and port it listens to with -p and -o. The default will only bind to localhost, which will not be accessible to anything other than 127.0.0.1.

like image 185
Doug Stevenson Avatar answered Sep 24 '22 07:09

Doug Stevenson