I’m new to Render and I’m trying to deploy a full-stack web app that I previously hosted on Heroku. I’ve been following the documentation and trying various combinations, but I’m still having trouble getting my app to deploy. I would really appreciate it if someone could take a look and help me troubleshoot the issue.
Thanks in advance for any help or advice you can offer. I’m looking forward to being a part of this community!
As Bergur kindly suggested, it does seem you may be using the wrong service type.
In general terms - and this may not be specific to your project - a common pattern for what you’ve described would be to have the frontend app as a Static Site and the backend as a Web Service, using the Node Native Environment. So two services, both linked to the same repo with settings like (but amended to your required values):
A Web Service for the “backend”
Root Directory: “backend”
Build Command: “npm install; npm run build;” (some backends don’t need to be built - will depend on what you’ve built)
Start Command: “node server.js” (or whatever file within “backend” that starts your backend app)
A Static Site for the “frontend”
Root Directory: “frontend”
Build Command: “npm run build” (static sites auto-install dependencies)
Publish Directory: “public” (this is Create React Apps default build directory, amend as required for your own project/framework)
Thank you both so much for taking the time to respond to my question. I really appreciate your help.
Alan, your detailed and thorough explanation was exactly what I needed to solve the problem. Your kindness and willingness to go above and beyond to assist me is greatly appreciated.