Angular6 Angular 6/7将我的web api重定向到默认路由

Angular6 Angular 6/7将我的web api重定向到默认路由,angular6,angular-routing,Angular6,Angular Routing,我的网站与我的web API托管在同一个域上 我遇到了一个问题,每当我尝试访问我的api URL:mywebsite.com/api时,我都会被重定向到NotFound页面 有没有办法防止这种情况 以下是我申请的路线: const appRoutes: Routes = [ { path: '', redirectTo: '/home', pathMatch: 'full' }, { path: 'home', component: HomeComponent

我的网站与我的web API托管在同一个域上

我遇到了一个问题,每当我尝试访问我的api URL:mywebsite.com/api时,我都会被重定向到NotFound页面

有没有办法防止这种情况

以下是我申请的路线:

const appRoutes: Routes = [
  { path: '', redirectTo: '/home', pathMatch: 'full' },
  { path: 'home',               component: HomeComponent },
  { path: '**',                 component: NotFoundComponent }
];