Skip to content

rwatts3/heroku-nuxtjs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Next.js on Heroku

Deploy Next.js universal web apps on Heroku.

Demo deployment from this repo:
https://nextjs.herokuapp.com

Download this repo as a Heroku-ready app template, or follow Production Deployment to push an existing app to Heroku.

Requires

Production deployment

Once you have a Next.js app working locally, you may deploy it for public access.

✏️ In the following instructions, replace $my-app-name with your own unique app name.

  1. Install the Heroku build adapter:
npm install @mars/heroku-nextjs-build --save
  1. Merge the following entries into package.json:
{
  "scripts": {
    "start": "next start -p $PORT",
    "postinstall": "heroku-nextjs-build"
  },
  "engines": {
    "node": "6.9.1"
  },
  "cacheDirectories": [
    "nextjs/node_modules"
  ]
}
  1. Ensure the app is a git repo, ignoring local-only directories:
git init
(echo node_modules/ && echo .next/) >> .gitignore
  1. Create the Heroku app:
heroku create $my-app-name
  1. 🚀 Deploy:
git add .
git commit -m 'Next.js app on Heroku'
git push heroku master
  1. ♻️ Deploy changes: add, commit, & push again.

About

Deploy Next.js universal web apps to Heroku

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%