0

I was trying to deploy my mern stack website using render . When I was deploying my backend repository , I am facing a port error,

I deployed my backend, repo so it gave me the backend link. I replaced all the 'localhost:4000' where 4000 is my port, with the backend link.

I tested the backend by running my frontend locally but it didn't work.

It was an ecommerce website in which the products are retreived from mongoDb through the backend folder. **I had seperated the project into three repositories, one with admin panel, one with frontend and one with backend. **

I deployed the backend repo first then It gave me the link for backend. Then as I mentioned before I put the link In my frontend project. But if it worked , the frontend website would have shown all the products it retreived from the backend. But the frontend is not showing the products which means something is going wrong.

I can't figure out what is causing the issue, as my backend has no .env file which I had not added in evironment variables. As far as the mongoDB connection goes, the mongoDB link is already linked through the index.js file in the backend repo.

source repo

4
  • Please share the exact content of the error. Also, do not link your entire repo, and read How to create a Minimal, Reproducible Example
    – pierpy
    Commented Jul 8 at 16:24
  • Thats just it I can't figure out the problem . I tried many ways, read the documentation of RENDER, but it didn't work. That's why I had to link the repo so that people who are seeing the issue can figure out whats causing the issue. Because I used stack overflow as the last resort in case I couldn't figure out what was the causing the issue Commented Jul 8 at 17:03
  • But you insist on not providing any debugging details. Inspect your requests on Devtools
    – pierpy
    Commented Jul 8 at 17:28
  • I had deployed my backend and it was deployed successfully . Now I also created API requests using thunderclient in vscode . I tried to check if there was any problem with my apis but no the apis are running absolutely well . But when iI put the backend link provided by RENDER in them , they stop working. Even though the backend is perfectly up and running. Commented Jul 8 at 17:35

1 Answer 1

0

According to your github repo, you are defining the port number as

const port = "https://sec-backend-1.onrender.com/";

where it should be a port number (ex: 3001) if you are not sure how to configure your app, you can refer to the instructions page of Render, and check the sample express project where you can follow the same implementation.

1
  • Earlier it was 4000 , I was doing some tinkering but it doesnt work Commented Jul 8 at 11:06

Not the answer you're looking for? Browse other questions tagged or ask your own question.