Support forum for ASP.NET Zero (https://aspnetzero.com/).
By statuscast
#31978 Hi,

We are using the DotNetCore MVC/jQuery solution..

We find that having all our API calls only be accessible via the path domain.com/api/services/app/Component/Method very inconvenient for our customers. We also realize that as most the API calls are dynamically generated from our AppServices, we are kind of locked in to this.

Since the actual API set we want to expose is fairly small, what we would like to do as a work around, so our customers can simply access the api from domain.com/api/Component/Method is create a small WebApi proxy layer that literally acts as a 100% passthru to the subset of AppService Api calls. My question is 3 fold:

1) what project do we implement this so that these WebAPI calls will be accessible within both the MVc and the Host proect

2) How do we set a custom route for these calls? I can't seem to get custom routes working in any Abp or AspNetZero projects

3) How do we ensure these calls are included in our Swagger UI?

Also, if there are already some example of custom non-AppService API's being exposed like this, I could probably figure this out, happy to be pointed to the right area if I'm just missing it...

thanks!
jasen
User avatar
By aaron
#31979 Related issue with workaround: aspnetboilerplate/aspnetboilerplate#3082

1) what project do we implement this so that these WebAPI calls will be accessible within both the MVc and the Host proect

Web.Core project.

2) How do we set a custom route for these calls? I can't seem to get custom routes working in any Abp or AspNetZero projects

[Route("")] attribute.

3) How do we ensure these calls are included in our Swagger UI?

[RemoteService] attribute.