{"id":13807551,"url":"https://github.com/mars/heroku-nextjs","last_synced_at":"2025-04-05T23:11:38.413Z","repository":{"id":51281979,"uuid":"72305192","full_name":"mars/heroku-nextjs","owner":"mars","description":"⏩ Deploy Next.js universal web apps to Heroku","archived":false,"fork":false,"pushed_at":"2023-10-25T08:05:58.000Z","size":114,"stargazers_count":372,"open_issues_count":4,"forks_count":37,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-29T22:08:53.305Z","etag":null,"topics":["heroku","nextjs","react","universal-app"],"latest_commit_sha":null,"homepage":"https://nextjs.herokuapp.com","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mars.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-10-29T19:31:03.000Z","updated_at":"2025-03-18T20:24:28.000Z","dependencies_parsed_at":"2024-01-08T08:04:03.498Z","dependency_job_id":null,"html_url":"https://github.com/mars/heroku-nextjs","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mars%2Fheroku-nextjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mars%2Fheroku-nextjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mars%2Fheroku-nextjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mars%2Fheroku-nextjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mars","download_url":"https://codeload.github.com/mars/heroku-nextjs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247411239,"owners_count":20934653,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["heroku","nextjs","react","universal-app"],"created_at":"2024-08-04T01:01:26.749Z","updated_at":"2025-04-05T23:11:38.396Z","avatar_url":"https://github.com/mars.png","language":"HTML","funding_links":[],"categories":["HTML","📦 Legacy \u0026 Inactive Projects"],"sub_categories":[],"readme":"#  [Next.js](https://nextjs.org/) on Heroku\n\nDeploy [React](https://facebook.github.io/react/)-based universal web apps on [Heroku](https://www.heroku.com/home).\n\n**Demo deployment** from this repo:  \nhttps://nextjs.herokuapp.com\n\n**A custom Node/Express server** is supported. Use it to:\n\n* combine a Node API with a Next/React UI\n* implement custom URL routes\n\n▶️ **[Next with custom Express server](https://github.com/mars/heroku-nextjs-custom-server-express)**\n\n## Requires\n\n* Heroku\n  * [command-line tools (CLI)](https://devcenter.heroku.com/articles/heroku-command-line)\n  * [a free account](https://signup.heroku.com)\n* [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)\n* [Node.js](https://nodejs.org)\n* [Next.js](https://github.com/zeit/next.js)\n\n## Production deployment\n\nOnce you have a [Next app working locally](https://nextjs.org/docs/#setup), you may deploy it for public access.\n\n1. Revise the `npm start` script to set the [web listener `$PORT`](https://devcenter.heroku.com/articles/dynos#local-environment-variables):\n\n   Merge this entry into **package.json**:\n\n   ```json\n   {\n     \"scripts\": {\n       \"dev\": \"next\",\n       \"build\": \"next build\",\n       \"start\": \"next start -p $PORT\"\n     }\n   }\n   ```\n\n   ⭐️ *In March 2019, [Heroku began running `npm run build` automatically](https://devcenter.heroku.com/changelog-items/1573), so the old `heroku-postbuild` script entry is no longer required.*\n\n1. Ensure the app is a git repo, ignoring local-only directories:\n\n   ```bash\n   git init\n   (echo node_modules/ \u0026\u0026 echo .next/) \u003e\u003e .gitignore\n   ```\n1. Create the Heroku app:\n\n   ```bash\n   heroku create $APP_NAME\n   ```\n1. 🚀 Deploy:\n\n   ```bash\n   git add .\n   git commit -m 'Next.js app on Heroku'\n   git push heroku main \n   ```\n   ⭐️ *As of July 2020, [Heroku supports `git push heroku main`](https://devcenter.heroku.com/changelog-items/1829) and encourages its use. The support for the branch name of 'master' will remain available for backwards compatibility.*\n\n1. ♻️ Deploy changes: add, commit, \u0026 push again.\n\n## Custom Config\n\nNext itself supports build \u0026 runtime configuration through the [next.config.js](https://nextjs.org/docs/#exposing-configuration-to-the-server--client-side) file.\n\nUse environment variables ([Heroku config vars](https://devcenter.heroku.com/articles/config-vars)) within your React components, no rebuilds required! Simply set [next.config.js](https://nextjs.org/docs/#exposing-configuration-to-the-server--client-side) values from the server's environment using `process.env` object.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmars%2Fheroku-nextjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmars%2Fheroku-nextjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmars%2Fheroku-nextjs/lists"}