Firebase 部署但不显示我的网站

问题描述 投票:0回答:1

嗨,我已经完成了

firebase init
firebase deploy --only hosting
。它显示了成功的模态消息

“欢迎光临 Firebase 托管设置完成

您看到此消息是因为您已成功设置 Firebase 托管。现在是时候去创造一些非凡的东西了!”

但是它没有显示我的网站。

我已经尝试过 Firefox 和 IE Edge,但仍然显示相同的消息。

请查看我的 firebase.json 文件:

{
  "functions": [
    {
      "source": "functions",
      "codebase": "default",
      "ignore": [
        "node_modules",
        ".git",
        "firebase-debug.log",
        "firebase-debug.*.log"
      ]
    }
  ],
  "database": {
    "rules": "database.rules.json"
  },
  "firestore": {
    "rules": "firestore.rules",
    "indexes": "firestore.indexes.json"
  },
  "hosting": {
    "public": "dist/cook4u",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ],
    "rewrites": [
      {
        "source": "**",
        "destination": "/index.html"
      }
    ]
  },
  "storage": {
    "rules": "storage.rules"
  },
  "emulators": {
    "auth": {
      "port": 9099
    },
    "functions": {
      "port": 5001
    },
    "firestore": {
      "port": 8080
    },
    "database": {
      "port": 9000
    },
    "hosting": {
      "port": 5000
    },
    "pubsub": {
      "port": 8085
    },
    "storage": {
      "port": 9199
    },
    "eventarc": {
      "port": 9299
    },
    "ui": {
      "enabled": true
    },
    "singleProjectMode": true
  },
  "remoteconfig": {
    "template": "remoteconfig.template.json"
  }
}

我已经尝试过stackoverflow和其他网站上的解决方案。它不能解决我的问题。我已确认我的index.html 和所有源代码都在我的公共文件夹中。另外,如何确定哪个页面是我网站的登陆页面?

这是我的公共文件夹。我有什么遗漏的吗?

public folder screenshot

Dist文件夹截图:

dist folder screenshot

cook4u folder screenshot

这是我运行部署命令时的输出:

  • hosting[cook4u-b3b8d]:文件上传完成 我主持[cook4u-b3b8d]:最终版本...
  • 托管[cook4u-b3b8d]:版本最终确定 我主持[cook4u-b3b8d]:发布新版本...
  • 托管[cook4u-b3b8d]:发布完成 我托管[cook4u-b3b8d]:开始部署...
  • 部署完成!3b8d]:在公共场合找到 119 个文件

项目控制台:https://console.firebase.google.com/project/cook4u-b3b8d/overview 托管网址:https://cook4u-b3b8d.web.app

firebase firebase-hosting
1个回答
0
投票

删除您的 .firebase 文件

  1. firebase 初始化
  2. 配置为单页应用程序(将所有网址重写为/index.html)? (是/否)n

不使用此更改您的index.html文件

© www.soinside.com 2019 - 2024. All rights reserved.