Skip to content

Instantly share code, notes, and snippets.

@fega
Last active August 9, 2021 21:00
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fega/44f71aadced0b3863b54d1a301f7abba to your computer and use it in GitHub Desktop.
Save fega/44f71aadced0b3863b54d1a301f7abba to your computer and use it in GitHub Desktop.
Quick deploy nuxt to heroku
# in the nuxt app directory
heroku create
# Set ENV_VARS
heroku config:set NPM_CONFIG_PRODUCTION=false HOST=0.0.0.0 NODE_ENV=production
# CREATE Procfile
echo 'web: npm run start' > Procfile
# ADD JSON script
npm i -g json
json -I -f package.json -e 'this.scripts["heroku-postbuild"]="npm run build"'
# Commit your changes
git add .
git commit -m "Added Nuxt deployment"
git push heroku master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment