I know that the command "ng serve" creates all my stuff in memory.
Now I have such url: http://localhost:4200/some-angular-route But I want this url: http://localhost:4200/subfolder/some-angular-route
My Question is how can I create such a "subfolder"? My Problem is that in my production environment the requests go via Spring Boot Zuul and there are prefixes at urls.
You can set base href as follows
@NgModule({
imports: [
RouterModule.forRoot(routes)
],
declarations: [AppComponent],
providers: [{ provide: APP_BASE_HREF, useValue: '/urlPrefix' }]
})
export class AppModule { }
Also, when you build your code, you can give --directory and --baseHref as follows.
ng build --deploy-url /mySubFolder/ --base-href /urlPrefix/
You can find more here https://github.com/angular/angular-cli/wiki/build
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With