简体   繁体   English

Apigility 测试返回页面未找到错误

[英]Apigility test returns page not found error

I'm following the apigility getting started tutorial to setup a simple RPC API.我正在按照 apigility入门教程设置一个简单的 RPC API。 My apigility dashboard is at:我的apigility仪表板位于:

http://localhost:8888/apigility/ui#//module/apiname/1 http://localhost:8888/apigility/ui#//module/apiname/1

When I add a simple service called ping that returns just a timestamp to acknowledge the request I attempt to test the service by issuing a GET request at:当我添加一个名为ping的简单服务时,该服务仅返回一个时间戳以确认请求,我尝试通过在以下位置发出 GET 请求来测试该服务:

http://localhost:8888/ping http://localhost:8888/pi​​ng

This returns error 404 although it's the same format as provided in the documentation for the API endpoint.这将返回错误 404,尽管它与 API 端点的文档中提供的格式相同。 Is there another endpoint where I can test the API before deploying it?是否有另一个端点可以在部署 API 之前对其进行测试?

It turns out it was a stupid error by myself.事实证明,这是我自己的一个愚蠢的错误。 I forgot the / before the service route (in the "Route to match" option), which means that the service route should be /ping instead of ping .我忘记了服务路由之前的 /(在“路由匹配”选项中),这意味着服务路由应该是/ping而不是ping After I added the slash it works.添加斜线后,它就可以工作了。

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

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