【发布时间】:2025-12-13 19:45:02
【问题描述】:
我正在为我的 Web 应用程序使用 Firebase 托管。
我想在我的 URL 的根目录显示 lp.html 并在其他任何地方显示 index.html。为了实现这一点,我已经像这样配置了我的 firebase.json:
{
"hosting": {
"public": "build/es6-bundled",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "/",
"destination": "/lp.html"
},
{
"source": "**",
"destination": "/index.html"
}
]
}
}
但是当我使用 firebase serve 并打开 http://localhost:5000/ 时,我看到了 index.html 中的内容。如何让根 URL 指向 lp.html?
【问题讨论】:
标签: javascript firebase firebase-hosting