【问题标题】:Firebase Hosting - 404 index.html - want to point to index.js insteadFirebase 托管 - 404 index.html - 想要指向 index.js
【发布时间】:2019-04-24 08:48:03
【问题描述】:

我正在尝试将基本的 Diet.js 单页应用程序部署到 Firebase。一切都在部署,虽然当我在浏览器中访问页面时显示 404 没有 index.html 文件。

我的项目入口点是 index.js。我的问题是我想我没有正确的配置来指向正确的位置。这是我的配置。

该应用的结构是在基本根目录下使用 index.js。然后视图在 public/views/html 和 index.html 那里。

"target": "<project target>",
      "public": "/",
      "ignore": [
        "firebase.json",
        "**/node_modules/**"
      ],
      "rewrites": [
        {
          "source": "./**",
          "destination": "index.js"
        }
      ]

我确定我在这里遗漏了一些东西。任何帮助都会很棒!

最好, 基兰

【问题讨论】:

    标签: firebase firebase-hosting


    【解决方案1】:

    您需要重写一个index.html 文件,然后加载并执行JavaScript。否则用户在导航到该站点时只会看到 JS 文件的内容。

    【讨论】:

      猜你喜欢
      • 2021-05-07
      • 2018-11-12
      • 2018-01-22
      • 2021-01-29
      • 2022-11-19
      • 2018-08-07
      • 2018-01-08
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多