ed-roh/mern-social-media

Form.jsx:61 POST http://localhost:5000/auth/register 404 (Not Found)

zoraizbinzahid opened this issue · 4 comments

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 :(

Check the port number and routes in server directory.

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 :(

how did you solved this error

app.use -> app.post
.use() method is used for middleware and .post() is function to send data to backend.