Deploying node app to heroku with client and server in two separate folders
As far as I know nowadays making two deploys is the most used solution for big projects evolving many devs, in one part your frontend with vue.js that will fetch the data from a remote api which is your backend and second deploy. Exactly, you will have to change your baseURL to app_name.herokuapp.com
Also you will probably will have to enable CORS.
Also if you want to try new things I recommend you try surge for your front deployment ;) so easy and so fast!
Maybe you already know it but, Heroku sets it's own ports so you will need to create a .env
file and assign it via ssh or manually in the Heroku dashboard.
This repo shows the setup of Node.js serving up a React frontend running on a single Heroku dyno: https://github.com/mars/heroku-cra-node
I was able to get one up and running using this as a guide. For cleanliness i modified my folder structure to be very similar to op's:
client/
server/
package.json
.gitignore
.env
(etc)