簡體   English   中英

Firebase 動態鏈接子域配置

[英]Firebase Dynamic Links subdomain config

假設我有一個域example.com 我通過托管和 cli 創建了第二個網站sub.example.com

{
  "hosting": [
    {
      "target": "app",
      "public": "public",
      "rewrites": [
        {
          "source": "**",
          "destination": "/index.html"
        }
      ]
    },
    {
      "target": "promos",
      "public": "public",
      "appAssociation": "AUTO",
      "rewrites": [
        {
          "source": "**",
          "dynamicLinks": true
        }
      ]
    }
  ]
}

現在,當我在沒有任何路徑前綴的情況下為sub.example.com創建動態鏈接時,它給了我一個sub.example.com信號:

It looks like you already have content served on this path. Specify a different path prefix to avoid conflicts with existing content.
  1. 我究竟做錯了什么?
  2. 另外,如果這個子域只用於鏈接,我還需要放public字段嗎? 我不想在上面顯示任何內容,只是鏈接...

我通過添加(或者更確切地說忽略)動態鏈接子域的公共文件夾來修復它。

"ignore": [
    "*"
  ],

我看到了這篇文章: https : //github.com/firebase/firebase-tools/issues/566 ,有人問了類似的功能問題,答案是刪除dist/index.html 但是由於我的實際站點依賴於它,我嘗試忽略它並且它似乎有效。

我用@cocacrave 的回答解決了同樣的問題。 只需共享完整的firebase.json文件。 * 應該有一個公共文件夾和設置,但我的公共文件夾是空的。

{
  "hosting": {
    "public": "public",
    "ignore": [
      "*"
    ],
    "appAssociation": "AUTO",
    "rewrites": [
      {
        "source": "/**",
        "dynamicLinks": true
      }
    ]
  }
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM