简体   繁体   English

API 网关与微服务和应用程序 API 与后备 Controller

[英]API Gateway with Microservices and Application API with Fallback Controller

I'm creating an application which will be connected to microservices (shared inside company).我正在创建一个将连接到微服务(在公司内部共享)的应用程序。
Attached screen shows a little of planned architecture App architecture diagram附件屏幕显示了一些计划架构应用程序架构图
As you can see API Gateway (created with Ocelot) will provide easy and quick access point for all endpoints from Microservices and Application API endpoints.如您所见,API 网关(使用 Ocelot 创建)将为来自微服务和应用程序 API 端点的所有端点提供简单快捷的访问点。 Application API will also have FallbackController which will return a View of builded Angular app.应用程序 API 也将具有FallbackController ,它将返回构建的 Angular 应用程序的视图。 And this Angular app will be using Gateway API endpoints.此 Angular 应用程序将使用网关 API 端点。

Is this a good approach or should I consider a different one?这是一种好方法还是我应该考虑另一种方法?
For ease of use, I'll explain how it's supposed to work during development:为了便于使用,我将解释它在开发过程中应该如何工作:
Angular application will be available on: https:localhost:2137 Angular 应用程序将在以下位置可用: https:localhost:2137
Application API Swagger docs will be available on: https:localhost:2137/swagger/index.html应用程序 API Swagger 文档将在以下位置提供: https:localhost:2137/swagger/index.html
Whole solution will contain GatewayAPI , Application API and Angular app .整个解决方案将包含GatewayAPIApplication APIAngular app
Application API will be responsible for providing endpoints that will allow to build a specific logic of this solution.应用程序 API 将负责提供端点,以允许构建此解决方案的特定逻辑。

Builded Angular app, located inside this project ( Gateway API + Application API + Angular app ), will be using Gateway API endpoints to work. Builded Angular app, located inside this project ( Gateway API + Application API + Angular app ), will be using Gateway API endpoints to work. Explanation解释
Angular will create requests to Gateway API to access Application API endpoints and Microservices API endpoints, but in itself it will be available within the Application (from FallbackController ). Angular will create requests to Gateway API to access Application API endpoints and Microservices API endpoints, but in itself it will be available within the Application (from FallbackController ).

I'm trying to get as much experience as I can, so I will be able to change my current job for something better:D Please, tell me whether what I wrote makes sense or not :)我正在努力获得尽可能多的经验,所以我将能够改变我目前的工作以获得更好的东西:D请告诉我我写的内容是否有意义:)

Yea you can do it like this, but I usually separate the Angular App, the Application API and the Gateway API into separate Microservices for better separation of concerns and the other benefits of that pattern.是的,你可以这样做,但我通常将 Angular 应用程序、应用程序 API 和网关 API 分离到单独的微服务中,以便更好地分离关注点和该模式的其他好处。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM