Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting 'Cannot GET /' when trying to connect to localhost:5000 Firebase

I am trying to get my localhost server on Firebase to work but I am continuing to get the following message in the browser 'Cannot GET /'. I took a look in the console and all it says is 'http://localhost:5000/ 404 (Not Found)'.

I have tried re-running the server using 'firebase serve' and that doesn't help. I ran 'firebase init' again and that didn't help either. I re-installed the firebase tools by running 'npm install -g firebase-tools' and then running firebase serve again and still nothing.

Not sure whats going on because it was initially working. I installed some grunt plugins and moved my index.html file under an html folder although I still have an index.html file under the public folder it still says 'Cannot GET /'

I have also tried in different browsers restarting them etc.

I am using a Mac OS X El Capitan.

Let me know if you need any more info. Thanks in advance

like image 783
sinake Avatar asked Oct 31 '16 21:10

sinake


2 Answers

I had the same issue when was trying to serve an Angular application with the firebase command. Firstly, you should see the firebase.json file. It should contain the "public" value, like:

{
    "public":"dist/ProjectName"
    ...
}

But the dist folder will be auto created only after you build the Angular project:

ng build --prod

After you can do the:

firebase serve

Hope it will be helpful for beginners.

like image 165
Taras Vovkovych Avatar answered Sep 27 '22 22:09

Taras Vovkovych


if this will help someone save time.. a possibility: it could be that the build step did not complete, this was my case, and the build/... directory had no index.html

like image 37
verNsíon1 Avatar answered Sep 27 '22 21:09

verNsíon1