Search code examples
firebasefirebase-hosting

How to make Firebase hosting /api rewrite request to app engine service


Currently I have the below firebase.json. I wanna rewrite all requests of https://myapp.firebaseapp.com/api point to https://myapp.appspot.com/api (one of my app engine services). Somethink like the dispatch.yaml that appengine uses, how can I do that? I don't wanna use a DNS and a subdomain like 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"
      }
    ]
  }
}


Solution

  • Firebase Hosting doesn't support rewriting paths to Google App Engine. Your rewrite options currently are: