[英]Firebase Cors issue for remote js files
所以基本上有一个主机应用程序从另一个 firebase url 获取远程微前端文件。
因此,远程应用程序托管在 firebase 上,例如www.firebas-ipsum.web.app
。
当主机应用程序尝试按预期获取文件www.firebas-ipsum.web.app/remoteEntry.js
时,我们收到 CORS 错误。
我们如何启用 CORS 来获取任何文件? 我在CORS 问题中尝试了解决方案,但它是针对请求的,而不是针对文件的。
通过向firebase.json.
{
"hosting": {
"public": "dist",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
],
"headers": [
{
"source": "**/**",
"headers": [
{
"key": "Access-Control-Allow-Origin",
"value": "*"
}
]
}
]
}
}
有关更多信息,请参阅官方文档
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.