Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save romanenko/d2f9bc895ead9870f666fe7e9a67b47e to your computer and use it in GitHub Desktop.
Save romanenko/d2f9bc895ead9870f666fe7e9a67b47e to your computer and use it in GitHub Desktop.
Deploy react-universally to Heroku from start to finish
fork/clone master branch: git@github.com:ctrlplusb/react-universally.git
cd [your-repo]
yarn install
edit config/index.js
change line 23:
port: getIntEnvVar('SERVER_PORT', 1337),
to:
port: getIntEnvVar('PORT', 1337),
edit ./package.json
add to scripts:
"postinstall": "yarn run build"
edit ./src/server/index.js
change line 55:
const listener = app.listen(config.port, config.host, () =>
to:
const listener = app.listen(config.port, () =>
create Heroku app:
heroku create [my-heroku-app]
heroku config:set NPM_CONFIG_PRODUCTION=false
git add .
git commit -m 'deploying to heroku'
git push heroku master
heroku open
@oyeanuj
Copy link

oyeanuj commented Oct 7, 2017

@romanenko Thanks for publishing this! Why did you set NPM_CONFIG_PRODUCTION=false?

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