如何使 Firebase 托管 /api 重写对应用引擎服务的请求
How to make Firebase hosting /api rewrite request to app engine service
目前我有以下firebase.json。我想重写 https://myapp.firebaseapp.com/api point to https://myapp.appspot.com/api(我的应用引擎服务之一)的所有请求。有点像 appengine 使用的 dispatch.yaml
,我该怎么做?我不想使用像 api.xxxx.com/api
这样的 DNS 和子域
{
"hosting": {
"public": "dist",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "/api**",
"destination": "https://myapp.appspot.com/api"
},
{
"source": "!/api/**",
"destination": "/index.html"
}
]
}
}
Firebase 托管不支持重写 Google App Engine 的路径。您的 rewrite options 目前是:
目前我有以下firebase.json。我想重写 https://myapp.firebaseapp.com/api point to https://myapp.appspot.com/api(我的应用引擎服务之一)的所有请求。有点像 appengine 使用的 dispatch.yaml
,我该怎么做?我不想使用像 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"
}
]
}
}
Firebase 托管不支持重写 Google App Engine 的路径。您的 rewrite options 目前是: