My build got successfully deployed but I am getting cannot /GET for my api
app.use(‘/api’,require(“./Routes/CreateUser”));
app.use(‘/api’,require(“./Routes/DisplayData”));
app.use(‘/api’,require(“./Routes/OrderData”));
Routes file is also present in my backend directory, it’s woking locally but not after deployment
i noticed that your code refers to the env variable PORT, did you add a value in your dashboard for PORT, it can be a number like 8081 for instance, but it does need to be set because you use process.env.PORT
It looks like they have the PORT in a .env committed at the root of /backend and set to 4000, but it would just fall back to the default of 10000 without being set in their Render dashboard as an environment variable.
However, if they’re not taking advantage of Render’s monorepo support, they’ll want to instead.
Additionally, they’ve committed their MongoDB Atlas credentials and should roll them.
I have changed my foodData as /get and after that I can able to access my all food data but I am running my frontend the page is still not able to load the food information. What changes I have to make to get the data visible in my page? all the frontend components are having my backend link attached.