Unable to receive request in next.js application

huangapple go评论75阅读模式
英文:

Unable to receive request in next.js application

问题

"I'm using Next.js first time and I have design my first API endpoint in this way as below in image.

Unable to receive request in next.js application"

"在第一次使用Next.js时,我设计了我的第一个API端点,如下图所示。"

"After that, when I hit the API from postman, I'm not receiving API in server.

http://localhost:3000/user/kyc/upload

Unable to receive request in next.js application"

"然后,当我在Postman中访问API时,服务器没有返回API。"

"I'm sure I'm doing some very silly mistake. Can anyone help me with this?"

"我确信我犯了一个非常愚蠢的错误。有人可以帮我吗?"

英文:

I'm using Next.js first time and I have design my first API endpoint in this way as below in image.

Unable to receive request in next.js application

After that, when I hit the API from postman, I'm not receiving API in server.

http://localhost:3000/user/kyc/upload

Unable to receive request in next.js application

I'm sure I'm doing some very silly mistake. Can anyone help me with this?

答案1

得分: 0

终于我弄清楚了,我在Postman的API端点中犯了一个很傻的错误。我没有在URL中加上/api

更新后的正确API端点如下。

http://localhost:3000/api/user/kyc/upload

现在对我来说正常工作了。

英文:

Finally I have figured it out and I have really made a silly mistake in API endpoint in postman. I didn't put /api in URL.

The updated and correct API end point is as below.

http://localhost:3000/api/user/kyc/upload

Now it's working fine for me.

huangapple
  • 本文由 发表于 2023年6月29日 23:50:49
  • 转载请务必保留本文链接:https://go.coder-hub.com/76582692.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定