Open Closed

Angular - Calling api/abp/application-configuration with a custom base href #351


User avatar
0
Jsg created
  • ABP Framework version: v2.9.0
  • UI type: Angular
  • Tiered (MVC) or Identity Server Seperated (Angular): No

Hello,

When I'm building my Angular app in production with this command "ng-build --prod --baseHref /Course/", the application start correctly but when the app trying to reach api/abp/application-configuration, the url is wrong : https://localhost:44321/Course/undefined/api/abp/application-configuration.

My environment.ts file has https://localhost:44321 as default api url. Is there a way to indicate to the CoreModule to not taking care about the baseHref when it trying to reach api ? Or must I have to create an interceptor to rewrite the url ?

Update: I investigated a little bit more. Firtly, using an interceptor can't work, I don't have the first part of the url (It's start from undefined/api..., and I can't rewrite the missing part). Secondly, I looked the source code of the application-configuration.service.ts file, and it seems the endpoint url can't be rewrited.

I saw the application-configuration call can be skipped in the CoreModule.forRoot(...), is it a good idea to skip it and write my proper application-configuration service with the good url ? And will it work ?

Thanks.


1 Answer(s)
  • User Avatar
    0
    Jsg created

    Hello,

    My problem is solved, it was my fault.

    Sorry for inconvenience.

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
Do you need assistance from an ABP expert?
Schedule a Meeting
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.2.0-preview. Updated on March 20, 2025, 18:00