Open Closed

Generate angular proxy for microservices #8679


User avatar
0
icoretchi created
  • Template: microservice
  • Created ABP Studio Version: 0.9.21
  • Current ABP Studio Version: 0.9.21
  • Multi-Tenancy: Yes
  • UI Framework: angular
  • Theme: leptonx
  • Theme Style: system
  • Run Install Libs: Yes
  • Database Provider: ef
  • Database Management System: sqlserver
  • Mobile Framework: none
  • Public Website: Yes
  • Include Tests: Yes
  • Dynamic Localization: Yes
  • Kubernetes Configuration: Yes
  • Grafana Dashboard: Yes
  • Use Local References: No
  • Optional Modules:
    • GDPR
    • FileManagement
    • TextTemplateManagement
    • AuditLogging
    • Chat
    • OpenIddictAdmin
  • ABP Framework version: v9.0.3
  • UI Type: Angular
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes/no
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

Hi,

I've updated angular proxy for one of my services with the following command: abp generate-proxy -t ng -url http://localhost:44313 -m product. As a result all generated files are created/updated in the app folder of the main project not in the microservice specific folder. For instance if the application is called Abc, when the proxy files are generated in the folder projects/abc/src/app/proxy/product-service, but not in the projects/product-service/src/lib/proxy/product-service. I have to mention that when the microservice is first created by abp studio the proxy files are generated correctly in the right location.

Thanks


3 Answer(s)
  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hi,

    You can use the --entry-point option

    https://docs.abp.io/en/abp/latest/CLI#options-6

    Please check if it works.

    Thank you.

  • User Avatar
    0
    icoretchi created

    Hi,

    It still doesn't work properly. This time it just creates the service folder in the in the main module folder. To be more specific running

    abp generate-proxy -t ng -url http://localhost:44313 -m classifier --entry-point classifier-service, will generate the following:

    CREATE projects/sia/classifier-service/src/proxy/generate-proxy.json (153998 bytes) CREATE projects/sia/classifier-service/src/proxy/README.md (1000 bytes) CREATE projects/sia/classifier-service/src/proxy/classifier-service/controllers/demo.service.ts (772 bytes) CREATE projects/sia/classifier-service/src/proxy/classifier-service/occupations/occupation-aggregate.service.ts (1209 bytes) CREATE projects/sia/classifier-service/src/proxy/classifier-service/occupations/occupation.service.ts (3461 bytes) CREATE projects/sia/classifier-service/src/proxy/classifier-service/occupations/models.ts (776 bytes) CREATE projects/sia/classifier-service/src/proxy/classifier-service/shared/models.ts (67 bytes) CREATE projects/sia/classifier-service/src/proxy/classifier-service/controllers/index.ts (32 bytes) CREATE projects/sia/classifier-service/src/proxy/classifier-service/occupations/index.ts (112 bytes) CREATE projects/sia/classifier-service/src/proxy/classifier-service/shared/index.ts (26 bytes) CREATE projects/sia/classifier-service/src/proxy/classifier-service/index.ts (173 bytes) CREATE projects/sia/classifier-service/src/proxy/index.ts (89 bytes)

    You can see that everythoing is generated in the projects/sia which is folder for main module.

    What I need, is to be generated in the projects/classifier-service folder.

    Cheers

  • User Avatar
    0
    Anjali_Musmade created
    Support Team Support Team Member

    Hello ,

    abp generate-proxy -t ng -url http://localhost:44313 -m classifier --entry-point classifier-service --output projects/classifier-service/src/proxy

    Please check this way

    -t ng : Specifies Angular as the client type. -url: The backend service URL. -m classifier: The module name for which you are generating proxies. --entry-point classifier-service: Ensures the proxy is generated for the correct entry-point module. --output projects/classifier-service/src/proxy: Explicitly sets the output folder for the generated proxy files.

    Thank you.

Made with ❤️ on ABP v9.2.0-preview. Updated on January 20, 2025, 07:44