Angular CLI - ng serve

I know the "ng serve" command creates all my stuff in memory.

Now I have url like this: 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, in my production environment, requests go through Spring Boot Zuul and there are prefixes in the urls.

+4


source to share


1 answer


You can set a base link like this:

@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 specify --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

+9


source







All Articles