Reputation: 2479
The project is divided into a backend code and react native client code.
Both are sharing one github project. It looks like this:
backend/
--- src/
--- package.json
client/
--- src/
--- package.json
For my heroku instance, I want to run only the backend code, but at the same time want to use continues integration feature from github.
Is there a way to make heroku run npm install & start only from the backend folder?
Upvotes: 2
Views: 398
Reputation: 13809
Create a package.json
in the root of the whole project (the parent dir of backend). You can do this with npm init --yes
.
Give that top-level package.json
file two scripts:
"scripts": {
"postinstall": "cd backend && npm install",
"start": "cd backend && npm start"
}
Should do the trick.
Upvotes: 4