Build successfully but cannot Get /

Hellow everybody,
I have deployed a Mern-stack application, the deploy seems successful but I get an error saying " Cannot GET / ". Link to the=> website link of my repo => GitHub - premj21/MERN_SOCIAL_MEDIA . I would really appreciate any help thank you!

Hi there,

The issue is here: ../ will be relative to the current working directory, not relative to where server.js is. ../client/build doesn’t exist, which is why you get the Cannot GET / (a 404 response). Try using app.use("/", express.static(path.join(__dirname, '../client/assets'))))


Render Support, UTC+10 :australia:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.