【发布时间】:2021-05-09 05:20:45
【问题描述】:
我正在使用微服务创建一个项目,现在我希望能够测试我使用 ocelot 作为编排器创建的 API 网关,但是我无法通过浏览器对其进行测试,API 无法访问它,有人可以帮忙吗?
ocelot.json:
{
"Routes": [
// Billing.API
{
"DownstreamPathTemplate": "/api/v1/Billing",
"DownstreamScheme": "http",
"DownstreamHostAndPorts": [
{
"Host": "billingapi",
"Port": "80"
}
],
"UpstreamPathTemplate": "/Billing",
"UpstreamHttpMethod": [ "GET" ]
}
]
}
当我运行项目并在浏览器 URL 中传递 /api/v1/Billing
当我通过 DownstreamPathTemplate 属性时。
没有任何东西退还给我。
【问题讨论】:
-
您确定主机名“billingapi”存在吗?同时发布您的错误信息
标签: asp.net asp.net-core microservices