How to deploy to Heroku if my client and servers are in separate folders?

Viewed 209

I have a repo with 2 folders - 1 for the server, 1 for the client, and each folder has its own package.json file.

I am trying to deploy the server to Heroku, but I get a "No default language could be detected for this app" error because the package.json is not in the root folder of the repo.

I created a new repo with just the server files inside it to test, and I am able to deploy to Heroku like this. But I do not want to do this, I'd like to keep the repo as is with the 2 separate folders.

Is there any way to do this without creating a new repo for the server?

1 Answers

You can simly create a docker-compose file that will spin up your client and server. Then after that, in heroku you need to choose the Docker in the deployment page.

More information about using docker and node: https://blog.logrocket.com/node-js-docker-improve-dx/

Related