heroku scripts code example

Example 1: export command for node in heroku

$ heroku config:set GITHUB_USERNAME=joesmith
Adding config vars and restarting myapp... done, v12
GITHUB_USERNAME: joesmith

Example 2: heroku scripts

// When pushing to heroku and it finds a package.json file in the root folder,
// the following npm scripts are gonna be executed:

"scripts": {
  "heroku-prebuild": "echo This runs before Heroku installs dependencies.",
  "build": "echo This won't run when there's a heroku-postbuild script. Otherwise it runs instead.",
  "heroku-postbuild": "echo This runs after Heroku installs dependencies, but before Heroku prunes and caches dependencies.",
  "heroku-cleanup": "echo This runs after Heroku prunes and caches dependencies.",
  "start": "echo You can specify you start script here."
}