在 firebase 上托管网站后,我无法查看内容

时间:2021-07-24 08:10:40

标签: firebase firebase-hosting

我已按照 firebase 指南在 firebase 托管上托管网站,但网站内容不可见。我在屏幕上看到了图片中分享的内容enter image description here

我该怎么办?请指导

1 个答案:

答案 0 :(得分:1)

确保您已将网站设置在正确的文件夹中,因为 Firebase 使用文件夹来包含特定服务的数据,public 用于托管,functions 用于云功能。您可以通过正确打开 firebase.jsonfile at the root of your project You should find something similar if you usedfirebase init` 来找出这是什么文件夹

  "hosting": {
    "public": "public",

运行 firebase deployfirebase deploy --only hosting 命令后,此文件夹中的所有内容都会上传到您的托管网站。 请务必同时检查 Firebase 提供的两个网址,因为 web.app 网址往往需要更长的时间来更新和部署。

  • <project-id>.firebaseapp.com

除了这些基本技巧之外,我还要确保您进入网站的入口点也是正确的,打开托管文件夹(公共或其他) - 并打开其中的 index.html 应该会产生您在 { 上找到的相同网站{1}}

相关问题