I recently started thinking about how to efficiently implement Angular in a microservice architecture.
Say we have a service for logging in, a service for managing users, and a service for viewing, adding, and editing some media. Each service has its own backend and interface, which are served in their own personal container. Thus, each part is then isolated with a well-defined API for interacting with the backend and its own isolated user interface using this API.
Now let me say that I would like to link each of these microservices in one application. I have two ways (as far as I can see):
I can configure the server to host each service under a sub-url, and the application is an SPA array, a kind of MPA (multi-page application).
I can create a main application where I set up routes for each of my micro-applications and download them on demand (custom PreloadingStrategy, I look at you).
I also found this , a process that I personally don’t think highly because you will lose many of the benefits of microservices in the continuous delivery of things. This is aimed at creating a monolith SPA from microservices.
Now the first alternative seems like a chorus, and not at all fun. The second is intriguing on me. I came to this article: https://coryrylan.com/blog/custom-preloading-and-lazy-loading-strategies-with-angular and immediately began to think; How can I use this to load pre-built Angular modules from a URL instead of packing them from the file system?
So my question is; Has anyone done this before? Is it possible? Are there any security issues with this? Or are there other alternatives to linking my microservices to a larger application?
source
share