当我访问 www.myweb.com/something 时,网络将显示以下消息:
{
"status": 404,
"message": "No Content"
}
这是我的 app.routes:
export const routes: RouterConfig = [
{ path: '', redirectTo: 'account', pathMatch: 'full' },
{ path: 'account', component: Account },
{ path: 'followers', component: Followers },
{ path: 'explore/:id', component: Explore },
{ path: '**', redirectTo: 'account' },
];
我使用角度通用,所以我有另一个名为 server.ts 的文件,其中包含以下代码:
// Routes with html5pushstate
// ensure routes match client-side-app
app.get('/', ngApp);
app.get('/followers', ngApp);
app.get('/followers/*', ngApp);
app.get('/account', ngApp);
app.get('/account/*', ngApp);
app.get('/explore', ngApp);
app.get('/explore/*', ngApp);
问题出在哪里?谢谢!