0
當我去www.myweb.com/something網頁將顯示消息:路由默認的404工作不
{
"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);
問題在哪裏?謝謝!
加載資源失敗:服務器迴應狀態爲404(未找到):( –
路由是否適用於www.myweb.com/account? –
是的,它工作正常 –