Open Closed

Generate-proxy issue with module startup template, "apiName = 'Default'" issue. #1904


User avatar
0
pontus created
  • ABP Framework version: v4.4.2
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): Angular
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

Using the latest CLI:

abp new Abc.Bookstore -t module -ui angular

I've run the migrations and the identity and host service starts up fine.

I've commented out the redis configuration and removed the DependsOn[typeof(AbpCachingStackExchangeRedisModule))] since we do not want to use Redis.

The angular project is working fine and running the dev-app.

The start-up generated component and the start-up generated service is working fine, I'm able to call the backend.

However if i try run the generate-proxy command, get an error, and it complains that the backend module 'app' does not exists in the API definition. This is fine since i can add the -a command and point to the Bookstore api-address and generate my proxys.

But!

The generated service file gets generated with the apiName = 'Default' which screws things up.

If i change it to apiName = 'Bookstore' things work.

I think it's as simple as changing the generated code to match the value given for the -a flag.


1 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    You're right. We already change it to module name in 5.0

    https://github.com/abpframework/abp/blob/dev/templates/module/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi/Samples/SampleController.cs#L8

Made with ❤️ on ABP v9.1.0-preview. Updated on November 11, 2024, 11:11