Deployed Successfully but showing cannot GET/

When deploying my full stack mern app, it deploys successfully but it’s showing CANNOT GET/.
This is the live url: https://product-feedback-app-inhn.onrender.com and this is the github link:GitHub - gbopola/product-feedback-app: Full stack product feedback app built with React, Styled Components, Redux, NodeJS, Express and MongoDB. I have included the correct environment variables.

Hi there,

This error would mean your backend is not configured to handle GET requests to the / route. I’m guessing you are expecting requests on other routes, for example /api/some/route. If you don’t want to see a message like this, you should add a handler for the / route.

Regards,

Keith
Render Support, UTC+10 :australia:

Thanks for the feedback. It seems to work locally, only shows this error on deployment.

Hi there,

On Render, you are only starting your backend because that is all npm start is doing. I can’t see any handlers for / in server.js. I assume locally, you are getting your frontend, but this isn’t what you are running on Render. If you also want to use your frontend on Render, you can deploy it as a separate service using a static site.

Alternatively, you can change your server.js file to serve your built frontend as static assets. This would also require you to build your frontend as part of your current service.

Reagrds.

Keith
Render Support, UTC+10 :australia:

Thanks got it working now, you are doing the Lord’s work :pray:

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