npx create-razzle-app --example with-heroku with-heroku
cd with-heroku
yarn start
Heroku manages app deployments with Git so:
git init
git add
git commit -m "Heroku deployment, first commit"
- Create a Heroku account
- Install Heroku CLI and authenticate
- Create Heroku app:
heroku create
- or
heroku create <appname>
if you want to specify an app name (checks for unique app name) - or
heroku git:remote -a <appname>
if you already created an App in the dashboard
- or
- Verify with
git remote -v
:
heroku https://git.heroku.com/<appname>.git (fetch)
heroku https://git.heroku.com/<appname>.git (push)
yarn deploy
orgit push heroku master
- or from another branch, other than master:
git push heroku <feature-branch>:master
- or from another branch, other than master:
- Console should complete with: https://appname.herokuapp.com/ deployed to Heroku
- Verify app by opening https://appname.herokuapp.com/
- Heroku expects a
yarn.lock
file to be able to recognise yarn as your package manager and process theyarn
commands - so make sure to runyarn install
before deployment, and to commit theyarn.lock
file.
This is a basic example of how to use razzle and deploy to Heroku with Git.