Skip to content

Instantly share code, notes, and snippets.

@Kcin1993
Last active October 1, 2017 13:08
Show Gist options
  • Save Kcin1993/ded6a8891e58864d2867e9c356b19e1d to your computer and use it in GitHub Desktop.
Save Kcin1993/ded6a8891e58864d2867e9c356b19e1d to your computer and use it in GitHub Desktop.
herkou-react-typescript.md

Brief

Deploy YOSGO Dashboard on heroku. Skip to the bottom Our solution

Some resource

Heroku command

  • Heroku command --> Find log heroku logs --tail
  • Heroku command --> Remote app heroku git:remote -a APPNAME
  • Heroku config --> NPM_CONFIG_PRODUCTION = false

Git Flow

For repeat change some tiny thing within one commit

git reset HEAD^
git add .
git commit -m 'Same NAME'
git push origin mater -f

Our solution

view this commit

1. About build on heroku

heroku-postbuild this script is for heroku build something. In package.json "heroku-postbuild": "Some cmd for build"

2. About heroku congigs(.env)

NPM_CONFIG_PRODUCTION = false --> This will install the devDependencies packages

3. About $PORT

app.listen(process.env.PORT || 8080). The 8080 is for dev and the process.env.PORT is for Heroku, Heroku will assign process.env.PORT auto.

4. About process.env.NODE_ENV

process.env.NODE_ENV will be true on heroku!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment