英文:
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.
"在第一次使用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
"然后,当我在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.
After that, when I hit the API from postman, I'm not receiving API in server.
http://localhost:3000/user/kyc/upload
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论