Ocelot API 网关 - 分配微服务的最佳 url 模板?
Ocelot API Gateway - Best url template to assign microservices?
我们公司有很多微服务。
我们还使用 Api 网关模式来路由这些微服务,实际上我们为此使用了 Ocelot。
应用于这些微服务的最佳 Url 格式是什么?
The important thing is that we use Rest architecture for our service
例如,我现在有这些模板:
api.example.com/microservice1/{controller}
example.com/api/microservice1/{controller}
你有什么看法?
恕我直言,
这个模式
example.com/api/microservice1/{controller}
如果您打算在 API 和 WFE(Web 前端)项目之间实现分离, 是很好的选择。事实上,这种方法在与前端项目的微前端架构一起使用时会非常好。
顺便说一句,我写了一个关于Ocelot和ASP.net核心的API网关系列,如果你想了解更多关于API网关架构的信息,你可以查看:
https://www.pogsdotnet.com/2018/08/api-gateway-in-nutshell.html
希望对您有所帮助!
我们公司有很多微服务。 我们还使用 Api 网关模式来路由这些微服务,实际上我们为此使用了 Ocelot。 应用于这些微服务的最佳 Url 格式是什么?
The important thing is that we use Rest architecture for our service
例如,我现在有这些模板:
api.example.com/microservice1/{controller}
example.com/api/microservice1/{controller}
你有什么看法?
恕我直言,
这个模式
example.com/api/microservice1/{controller}
如果您打算在 API 和 WFE(Web 前端)项目之间实现分离,是很好的选择。事实上,这种方法在与前端项目的微前端架构一起使用时会非常好。
顺便说一句,我写了一个关于Ocelot和ASP.net核心的API网关系列,如果你想了解更多关于API网关架构的信息,你可以查看:
https://www.pogsdotnet.com/2018/08/api-gateway-in-nutshell.html
希望对您有所帮助!