Open Closed

Dynamic JavaScript API Client Proxies Question #9001


User avatar
0
dhaoo created

Hello, I created a hierarchical structured project using the command: abp new Acme.BookStore -m none --tiered --theme leptonx-lite -csf. In this newly created project, I copied the code from the examples in Part 1 to Part 10 of the official tutorial. However, after running and debugging the project, I encountered errors in the generation of Dynamic JavaScript API Client Proxies in the Acme.BookStore.Web project.
Can "Dynamic JavaScript API Client Proxies" is used for the Tiered layout of project?
Could you please tell me what might be causing this issue?
微信图片_20250320095117.png

My project code has already been uploaded to the repository: https://github.com/FIFAKING/BookStore.git


1 Answer(s)
  • User Avatar
    0
    berkansasmaz created
    Support Team .NET Developer

    Hi,

    Here is a detailed explanation of why this does not work in the tiered architecture and what needs to be done to make it work. If you have any questions, please feel free to ask.

    I suppose you are using auto API controllers feature which is default with the startup template.

    In such case, ABP can not generate Dynamic JavaScript Proxies as @maliming stated.
    For tiered usage, you should manually create API controllers in the .HttpApi project and call the related application service. I guess you understand the reason; because Web project will have no reference to the app layer as @maliming said. But when you create manual API controller in the HttpApi project, Web will know the API and can produce dynamic JS proxies.

    Because of this reason, we always manually create API Controllers for pre-build modules to make them tiered-compatible. Example: https://github.com/abpframework/abp/blob/dev/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/IdentityUserController.cs

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