Angular 5 Generic Exclude Path from Server Rendering

Is it possible in any way to force only the browser to provide a specific path for the universal Angular 5 application? I have the following routes in app.module.shared.ts

@NgModule({ declarations: [...], imports: [ ...... RouterModule.forRoot([ { path: '', redirectTo: 'home', pathMatch: 'full' }, { path: 'home', component: HomeComponent }, { path: 'auth-callback', component: AuthCallbackComponent}, { path: '**', redirectTo: 'home' } ] ) ], providers: [] }) 

And I want mysite.com/auth-callback to only be displayed in the browser, and not on the server side. Thanks for any help, could not find any help.

+5
source share
1 answer

Not yet, you put the api folder in angular 2 root .. if you do, there will be a conflict between the Angular2 / 4/5 route and the api routes ...

So, do you use a subdomain or put angular and api code in different directories.

0
source

Source: https://habr.com/ru/post/1273675/


All Articles