ed-roh / mern-social-media

Complete React MERN Full Stack Social Media App
952 stars 849 forks source link

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

Closed zoraizbinzahid closed 1 year ago

zoraizbinzahid commented 1 year ago

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 1 year ago

Check the port number and routes in server directory.

zoraizbinzahid commented 1 year ago

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 1 year ago

how did you solved this error

rutujp78 commented 1 year ago

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