0
votes

I am new to using Firebase and after I developed a react project, I tried to deploy my application with firebase but it doesn't work. Firebase is already connected to my app for the database. This is what I did to deploy it:

firebase login

firebase init (I tried all possibilities, I always chose HOSTING and then as a public directory I tried with public / build / dist )

firebase deploy

but still, it gave me 2 links as following : enter image description here

and when I click to the Hosting like, this is what it shows (not the app) :

enter image description here

Also, this is what my firebase.json file looks like (when I use build as a public directory)

{
  "hosting": {
    "public": "build",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ]
  }
}

maybe I do have to do some changes in this file ?

I also tried firebase serve to test it locally, and it shows me the same page (welcome page). But when I try my app with ng serve, it works.

Could you help me please ? Thank you !

1

1 Answers

0
votes

I think you may be opening the wrong url. If localhost says the setup is complete, you shouldn't expect to see your hosted website in localhost, but rather at the link which firebase deploy provided for you.

In your case, that should be https://gouvproject-64316.firebaseapp.com (take a look at Hosting URL in your console or terminal). Keep in mind that localhost addresses are hosted locally within your device so that means no one else has access to them but you. This is what you do when you setup a server on your pc (i.e. through node.js) . On the contrary, hosted websites are saved in a server remotely by a hosting service provider (in this case done by Firebase through firebase deploy) and are given a public worldwide-unique address for anyone to be able to visit them.

I visited the page url and your website seems to be hosted just fine, by the way! If you need help in anything related, don't hesitate to ask.

Hope this helped, Panos :).