如何向App Engine服务发出Firebase托管/ api重写请求

时间:2019-04-12 18:38:08

标签: firebase firebase-hosting

目前,我有以下firebase.json。我想将https://myapp.firebaseapp.com/api点的所有请求都重写为https://myapp.appspot.com/api(我的应用引擎服务之一)。像appengine使用的dispatch.yaml这样的东西,我该怎么做?我不想使用DNS和像api.xxxx.com/api

这样的子域
{
  "hosting": {
    "public": "dist",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ],
    "rewrites": [
      {
        "source": "/api**",
        "destination": "https://myapp.appspot.com/api"
      },
      {
        "source": "!/api/**",
        "destination": "/index.html"
      }
    ]
  }
}

1 个答案:

答案 0 :(得分:0)

Firebase托管不支持重写Google App Engine的路径。您的rewrite options当前是: