A
A
albertalexandrov2018-12-04 08:07:31
Heroku
albertalexandrov, 2018-12-04 08:07:31

Why is the react-express-heroku application deployed this way?

Hello everyone!)
There is an application https://github.com/LaptopTheOne/react-express-hero... where the front is implemented on react.js, and the API server is on express.js. Deployed on heroku.
Appeared with deployment. The file package.json https://github.com/LaptopTheOne/react-express-hero... contains the following scripts:

"scripts": {
    "start": "node ./bin/www",
    "heroku-postbuild": "cd client/ && npm install && npm install --only=dev --no-shrinkwrap && npm run build",
    "client": "cd client && npm start",
    "dev": "concurrently --kill-others-on-fail \"npm run start\" \"npm run client\""
  }

Why in this format:
"start": "node ./bin/www",
 "heroku-postbuild": "cd client/ && npm install && npm install --only=dev --no-shrinkwrap && npm run build"

not like this, for example:
"start": "node ./bin/www && cd client && npm install && npm install --only=dev --no-shrinkwrap && npm run build"

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2018-12-04
@albertalexandrov

Obviously postbuild and start are different stages of the lifecycle. The postbuild step is executed once during deployment, while start can be executed many times during restarts, migrations, scaling, and so on.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question