我可以在哪里设置Mean Stack Application的默认路径? 本地路径是
http://localhost:3000
但我希望应用程序从
开始http://localhost:3000/myapp/
在我看来,我希望我的路由不会改变:
const appRoutes: Routes = [
{ path: '', component: HomeComponent, pathMatch: 'full', canActivate: [AuthGuard] },
{ path: 'login', component: AuthComponent },
{ path: 'register', component: RegisterComponent },
// otherwise redirect to home
{ path: '**', redirectTo: '' }
];
当我在我的服务器上部署时,我想让我的应用程序在端口80上运行并在其分离的上下文中运行,如下所示:
http://www.myserver.com/myapp/
路由听起来像这样:
http://www.myserver.com/myapp/home
http://www.myserver.com/myapp/login
如果我指向未设置的路线:
http://www.myserver.com/myapp/notexists
它在其基础上重定向:
http://www.myserver.com/myapp/
提前感谢。