Form.jsx:61 POST http://localhost:5000/auth/register 404 (Not Found)
zoraizbinzahid opened this issue · 4 comments
zoraizbinzahid commented
Hey There,
I'm getting this error while posting Register request from this code:
const savedUserResponse = await fetch(
"http://localhost:5000/auth/register",
{
method: "POST",
body: formData,
}
);
need Help :(
rutujp78 commented
Check the port number and routes in server directory.
zoraizbinzahid commented
Check the port number and routes in server directory.
PORT: const PORT = process.env.PORT || 5000;
Route: app.use("auth/register", upload.single("Picture"), register);
cant find out the error :(
Shubhamnitjsr093 commented
how did you solved this error
rutujp78 commented
app.use -> app.post
.use() method is used for middleware and .post() is function to send data to backend.