[英]Proxy Error when trying to Register or Login and no Network response
This is my first trial at web development.这是我在 web 开发中的第一次试用。 I used React-Redux and created a React.js app in the client folder.
我使用了 React-Redux 并在客户端文件夹中创建了一个 React.js 应用程序。 My backend code language is Node.js and MongoDb for my database.
我的数据库的后端代码语言是 Node.js 和 MongoDb。
This is my project.这是我的项目。
https://github.com/FaridaElOraby/newest_version.git https://github.com/FaridaElOraby/newest_version.git
It is working on my pc but when I tried to run it on another PC, I could not login or register.它在我的电脑上运行,但是当我尝试在另一台电脑上运行它时,我无法登录或注册。 When I fill in the fields when logging in or registering and press on submit nothing happens.
当我在登录或注册时填写字段并按下提交时,没有任何反应。 I should get redirected to the homepage or to login page.
我应该被重定向到主页或登录页面。 There is also no network response.
也没有网络响应。 I even tried to console the "res" in the backend to see if the info gets passed to the backend, there was nothing.
我什至试图控制后端的“res”以查看信息是否传递到后端,但什么也没有。 I don't know why the backend does not see my request.
我不知道为什么后端看不到我的请求。 There is a proxy error that pops up from localhost:3000 to localhost:5000 (server).
从 localhost:3000 到 localhost:5000(服务器)弹出代理错误。 If I don't fill in any fields and try to submit, an error pops up in the console Network Error bad request localhost:3000/api/user/register.
如果我不填写任何字段并尝试提交,控制台会弹出错误 Network Error bad request localhost:3000/api/user/register。
I was using mongoose for the DB at the backend and the mongo link was expired so it returned a network error.我在后端的数据库中使用 mongoose 并且 mongo 链接已过期,因此它返回了网络错误。 I changed the link at the backend with a working one and it wokred.
我用一个工作的链接更改了后端的链接,它工作了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.