Solid JS和Firebase主机不显示路由



我正在试用Solid。我在firebase上托管了一个简单的web应用程序,它显示了index.html文件,但只显示了其他路由的404错误。Solid JS将index.html文件夹与其他文件一起存储在dist/public中。

404.htmljson ssr-manifest.jsonAssets/index.html路由清单。

这个路由在我的开发服务器上工作得很好,但在firebase或netlify上不行。看起来firebase和netlify都有允许指定重定向的配置选项,但是我要重定向到哪个html文件呢?

如果你运行firebase init,你的项目应该有一个firebase.json。这是我项目中的一个例子。注意重写数组。它说每个链接到我的网站应该由index.html处理,这是React项目服务的地方。Solid-js应该有类似的工作

{
"hosting": {
"public": "build",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}

这里的文档https://firebase.google.com/docs/hosting/full-config#rewrites

最新更新