start command: node server/src/index.js
I added my env variables too.
After this I created a static site linking the same repo and used this commands :
build command: npm run render-postbuild
publish directory: ./client/build
I also added env variables.
After this I got differents errors of this type :
I got the Not Found from express (I think it’s from express)
Got this too : ENOENT: no such file or directory, stat ‘/opt/render/project/src/client/build/index.html’
And my api endpoints are not working too, I tried to add some rewrites but it’s not working or do I have to change the endpoints in frontwend with the new onrender generated ?
Thanks for reading this and if you know what is the problem to solve this.
It depends on how you want to set this up, the error seems to imply you want to have a single Web Service serving the API and React App through Express.
In that case, the “no such file” shows a “client/build” folder as part of the path, this usually implies that the build script hasn’t been run to generate that folder. Your Build Command on a single service setup would need to:
install backend dependencies
install frontend dependencies
run a build script for the frontend
any other commands, DB migrations, etc.
If you want to use separate services and have the React app as Static Site, then Express no longer needs to serve the static files. You’ll need to configure the static site to make its client-side requests to the backend URL.
Hi @al_ps apologies this is not related to the topic above. Noone has responded to my situation query. Hence this.
Some context about it → i deployed one full stack app , with static and webservice yesterday and after a while,when i visited the url, i was getting -
“The service has been suspended by the. Owner”
And i am also logged out of my account, unable to login n i get redirected to login over n over. My previously deployed service is also down now. All my projects were purely for learning purposes.
These are also mine. Moreover, after few minutes of deploying my project i started getting deceptive site ahead warning on the deployed service from render. I read that render provides SSL certificates and had cloudflare certificate on my site as well. Yet the warning persisted even after i changed my service name to nflix instead of Netflix…
For Any context and action regarding my account, could u please help me understand what caused all of it…