I have a react app + api I’d like to deploy. My project is split into two directores, backend/ and frontend/. My backend/package.json file has this build command:
"build": "cd ../frontend && npm install && npm run build"
This works fine locally. When I try to set my Netlify deployment settings, ideally, they would look like this:
Base: “backend/”
Command: “npm run build”
Publish: “frontend/build/”
However, this is automatically prepending backend to the pubilsh path, so it becomes “backend/frontend/build/” which does not exist.
I’m sure I’ve got my setup fundamentally wrong (I’m relatively new to React). How can I package my server code + my frontend code together to deploy to production?
I moved my backend code into a function but I’m having trouble getting my app to hit the api endpoint.
Netlify has my api endpoint here at https://<prod_domain>/.netlify/functions/api. My base in my netlify.toml file is frontend/. Here is my code structure: