我想创建一个 ALB,它应该根据到不同网站的路径路由我的流量。例如。
example.com/apple/ 应该转到 8080
example.com/grapes/ 应该转到 8180
example.com/oranges/ 应转到 8280
您能否指导我,我怎样才能实现这一目标。
到目前为止我所尝试的如下。
但这种方法不起作用,流量仅适用于默认路由。
LB:端口/路径/
我不想在 URL 中包含端口。
请帮忙
全部,
在实施身份验证保护之前,我能够在登录和注册屏幕中隐藏我的导航栏。通过读取 component.ts 中的路由事件并通过 ngIf 隐藏导航栏。在我实现了 auth guard 后,auth guard 到登录页面的路由没有隐藏下面的导航栏是我的代码..
在这里,我的 auth 守卫服务将检查用户是否通过 auth 服务(将从 cognito 获取数据)进行身份验证。现在,我怎样才能从 auth 守卫发生的路线中隐藏导航栏。请帮忙
应用程序组件.html
<app-toolbar *ngIf="isShowNavbar" ></app-toolbar>
<router-outlet></router-outlet>
Run Code Online (Sandbox Code Playgroud)
app.component.ts
import { Component,OnInit } from '@angular/core';
import {AuthorizationService} from "./authorization.service";
import { Router, ActivatedRoute, UrlSegment, NavigationEnd } from '@angular/router';
import { Observable } from 'rxjs';
import { first, distinctUntilChanged, throttleTime } from '../../node_modules/rxjs/operators';
@Component({
// tslint:disable-next-line: component-selector
selector: 'my-app',
templateUrl: './app.component.html',
styleUrls: [ './app.component.css' ]
})
export class AppComponent implements OnInit {
isLoggedIn$: Observable<boolean>; …Run Code Online (Sandbox Code Playgroud)