0

我已经在我们的本地机器上安装了 Tyk(仪表板、网关和泵)作为 docker 映像。

我们通过 Tyk Dashboard UI 通过以下配置创建了 API(系统管理 -> APIs -> 添加新 API)。

API 名称:我的 API 监听路径:/test-api/ 目标 URL:http ://httpbin.org/

现在的问题是当我们访问 API 时出现“未找到”错误。

有人可以帮我解决这个问题吗?

请求:curl -X GET http://api-dashboard:3000/test-api/get -v 响应:404(未找到)

Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to api-dashboard (127.0.0.1) port 3000 (#0)
> GET /test-api/get HTTP/1.1
> Host: api-dashboard:3000
> User-Agent: curl/7.58.0
> Accept: */*
>
< HTTP/1.1 404 Not Found
< Access-Control-Allow-Credentials: true
< Cache-Control: no-store, no-cache, private
< Strict-Transport-Security: max-age=63072000; includeSubDomains
< X-Content-Type-Options: nosniff
< X-Frame-Options: DENY
< Date: Wed, 24 Apr 2019 08:58:35 GMT
< Content-Length: 9
< Content-Type: text/plain; charset=utf-8
<
* Connection #0 to host api-dashboard left intact
4

1 回答 1

2

您正在调用仪表板,您应该调用您的网关 URL。例如http://api-gateway:8080/test-api/get

Tyk 网关默认端口为 8080。

于 2019-05-03T08:35:43.563 回答