[英]angular 2 http:// and https:// routes
There is an Angular 2 based application with two routes: 有一个基于Angular 2的应用程序,它有两条路线:
const appRoutes: Routes = [
{
path: 'home',
component: HomeComponent
},
{
path: 'login',
component: LoginComponent
}
];
The "/home" route should go to " http://mysite/home " and "/login" should go to " https://mysite/login ". “ / home”路由应转到“ http:// mysite / home ”,“ / login”应转到“ https:// mysite / login ”。 Please pay attention the first one starts with "http://" and the second one starts with "https://".
请注意,第一个以“ http://”开头,第二个以“ https://”开头。 How is it possible to configure the router to use different origins for routes?
如何将路由器配置为对路由使用不同的来源? Or at least http / https for the same origin?
或至少有相同来源的http / https?
This is not something particular to Angular2. 这对Angular2而言并不是特别的。 The routing takes whatever the schema is from the URL when you load the application.
加载应用程序时,路由将从URL获取任何架构。 You have a couple of options to get the login to require HTTPs.
您有两种选择来使登录名需要HTTP。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.