A guide to deploying your full stack MERN app to Render
Prereqs:
Github Account
Render Account
A fully functional MERN APP and it's re...
For further actions, you may consider blocking this person and/or reporting abuse
Hi Greg,
Great tutorial!
I followed steps from this tutorial, but i can't connect /api calls to my express server.
My project is at:
github.com/SlavkoPar/support-mern
Instead of redirection, i added 2 env variables:
REACT_APP_HOST: support-knowledge.onrender.com
REACT_APP_PORT: 4001
so i get a call:
support-knowledge.onrender.com:400...
i even created test call:
support-knowledge.onrender.com:400...
but I always get the response:
net::ERR_CONNECTION_TIMED_OUT
Do you have any suggestion?
Regards!
In my Web Service I tried:
curl -X POST 127.0.0.1:4001/api/test
and received the response: 'Welcome to GeeksforGeeks'
My site is: support-knowledge.onrender.com/
I found solution for my /api/* calls, setting my Web Service link to ‘Rewrite rules’:
/api/*
support-knowledge-service.onrender...
Rewrite
Best Regards !
Great guide! 🤝
great tutorial
Hi Greg, if you can give me advice please?
I tested in local host successful..
I have succeeded deployed web service, but cannot deploy static site, it keeps saying
Great appreciation!
Issue resolved! For anyone running into same issue as me, instead of
"render-postbuild": "NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client"
I delete config string, become
"render-postbuild": "npm install --prefix client && npm run build --prefix client"
The build Command in the webservice has yarn which does not seem correct. what did you change it to?
I still use yarn without any issue opyjo. You had any issue? can post the error, we see together?
Thanks for the feedback share your repo and errors and I will help debug. The 'yarn' in the build command input box for Web Services is not in use, thus you shouldn't have any issues with that. Essentially I am not building anything from the services(backend server), but you certainly could do it that way. Since my repo has the frontend and backend in one repo when the script render-postbuild is ran it comes from the root folder housing the frontend and backend. I know when the "NPM_CONFIG_PRODUCTION=false this is just a way to set the production to false until the npm run build is compiled then on the NODE_ENV side it will know we are in a production environment.
Hope this helps.
That's great. I've gotten what I am looking for... timely.
hello Greg, I need your help in this deployment. I did as you mentioned above. but for some reason my backend is failing to deploy. only thing i changed from your step was in build command. i changed yarn to npm install. help me with this issue please
the error in pic actually shows that concurrently is not found. i even tried to run it with yarn, its showing the same thing. But in my local machine concurrently runs with the same command "npm run dev"
my project github link: githublink
ok. I solved this error by adding the dev dependencies inside the dependencies in package.json file. thanks for this guide greg