我的角度应用程序可以在我的本地主机上完美运行:4200。现在,我已将其部署到服务器。 homepage看起来还不错。由于网址无效,它重定向到错误页面。该页面的有效网址为this.
如果url在我的本地计算机上通过了两个路由参数,但由于某些原因,它在实时服务器上不起作用,我将获得有效的页面。
const routes: Routes = [
{
path:":restaurantId/:mobileNo",
component: LandingComponent,
},
{
path:"",
component: LandingComponent,
canActivate: [AuthGuard]
},
{
path:"error",
component: ErrorComponent,
},
];
index.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Freshii</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body>
<app-root></app-root>
</body>
</html>