【发布时间】:2020-03-22 00:06:23
【问题描述】:
我有一个 Angular 项目,其中路由在 localhost 中工作,但是当我将项目部署到 Firebase 托管时,只有 base-url 工作。 这是我的路由:示例 https://baseurl/jegharaldrigkategori 在 Firbase 托管中不起作用。它说“找不到页面”
const routes: Routes = [
{
path: '',
redirectTo: 'home',
pathMatch: 'full'
},
{
path: 'home',
component: HomeComponent
},
{
path: 'jegharaldrigkategori',
component: JegharaldrigkategoriComponent
},
{
path: 'jegharaldrig',
component: JegharaldrigComponent
},
{
path: 'udfordring',
component: UdfordringComponent
},
{
path: 'terning',
component: TerningComponent
},
{
path: 'overunder',
component: OverunderComponent
}
];
【问题讨论】:
-
您的
firebase.json配置是什么样的?是否设置为为所有路径提供index.html?
标签: angular typescript firebase angular-routing firebase-hosting