Firebase部署显示欢迎屏幕 [英] firebase deploy gives welcome screen

查看:67
本文介绍了Firebase部署显示欢迎屏幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对使用Firebase并不陌生,在我开发了一个React项目之后,我尝试使用firebase部署我的应用程序,但是它不起作用.Firebase已经连接到我的数据库应用程序.这是我部署它的工作:

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登录

firebase init (我尝试了所有可能,我始终选择HOSTING然后作为公共目录,我尝试使用public/build/dist

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

firebase deploy

但是,它仍然给了我2个链接,如下所示:

but still, it gave me 2 links as following :

当我单击"Hosting"(主机)时,这就是它的显示内容(不是应用程序):

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

此外,这也是我的firebase.json文件的外观(当我将build用作公共目录时)

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 ?

我还尝试使用firebase服务在本地对其进行测试,它向我显示了同一页面(欢迎页面).但是当我尝试使用ng serve应用时,它就可以工作.

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.

你能帮我吗?谢谢 !

推荐答案

我认为您可能打开了错误的网址.如果localhost表示安装已完成,则您不应期望在localhost中看到托管网站,而应该在 firebase部署为您提供的链接上看到.

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.

在您的情况下,应为 https://gouvproject-64316.firebaseapp.com (在控制台或终端中查看托管网址).请记住, localhost 地址是在您的设备本地托管的,这意味着只有您自己,其他任何人都无法访问它们.这是在PC上设置服务器(即通过node.js)时要做的.相反,托管网站由托管服务提供商远程保存在服务器中(在这种情况下,由Firebase通过 firebase deploy 完成),并在全球范围内具有唯一性.任何人都可以访问的地址.

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.

我访问了页面URL,顺便说一句,您的网站似乎托管得很好!如果您需要任何相关帮助,请随时询问.

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.

希望这有帮助,Panos:).

Hope this helped, Panos :).

这篇关于Firebase部署显示欢迎屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆