I have two ABP applications:
- Modular App (A)
- Single layer App (B)
They both expose APIs. I want app A to make a call to app B's endpoint. I've read that the best way to do it is to generate static proxies in app A because then I don't have to deal with HttpClient.
I've followed the docs and successfully generated client proxies. The problem is that app A seems to need a reference to app B's .csproj - the proxy generation does not create a Dto or AppService in app A, it just adds using
statement to B's namespace.
Is there a way to keep these two apps completely separate i.e. without adding project references and keeping the communication just on the HTTP request level?
3 Answer(s)
-
0
hi
The module must be referenced.
-
0
Well, that's disappointing. Could you please explain the reasons for such behavior?
If I had two really complex application I would need to keep them in the same solution (or at least in the same repository) which might disrupt the development process. If I understood correctly - the communication still happens on HTTP requests level, Why would I need to couple these two applications then? It should work like with angular proxies - DTOs and services should be generated in the client app.
Also, it would be useful if you provided an example of proper way to create HttpClient and make HTTP requests in ABP app.
-
0
hi
abp is modular, when you want to call the API of another project, you can only refer to its contract or http client module, which is a modular design.
Also, it would be useful if you provided an example of proper way to create HttpClient and make HTTP requests in ABP app.
The default module template already includes these APIs and examples.