{"id":19261977,"url":"https://github.com/hacksu/heroku-lesson","last_synced_at":"2026-03-01T17:34:40.605Z","repository":{"id":149141458,"uuid":"239631031","full_name":"hacksu/heroku-lesson","owner":"hacksu","description":"Host your own website for free with heroku!","archived":false,"fork":false,"pushed_at":"2020-11-10T23:56:12.000Z","size":5,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-02-23T18:44:39.939Z","etag":null,"topics":["beginner","lesson"],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hacksu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-10T22:57:31.000Z","updated_at":"2020-11-11T00:35:48.000Z","dependencies_parsed_at":"2023-09-03T00:46:47.582Z","dependency_job_id":null,"html_url":"https://github.com/hacksu/heroku-lesson","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hacksu/heroku-lesson","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hacksu%2Fheroku-lesson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hacksu%2Fheroku-lesson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hacksu%2Fheroku-lesson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hacksu%2Fheroku-lesson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hacksu","download_url":"https://codeload.github.com/hacksu/heroku-lesson/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hacksu%2Fheroku-lesson/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29976279,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T16:35:47.903Z","status":"ssl_error","status_checked_at":"2026-03-01T16:35:44.899Z","response_time":124,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["beginner","lesson"],"created_at":"2024-11-09T19:29:15.888Z","updated_at":"2026-03-01T17:34:40.569Z","avatar_url":"https://github.com/hacksu.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# heroku-lesson\nHost your own website for free with heroku!\n\n## Creating your Heroku Account\n[Sign up](https://signup.heroku.com/login) for Heroku. Be sure to __verify your email__.\n\nOnce you have an account, [Login and go to your Dashboard](https://dashboard.heroku.com/apps).\n\n## Install the Heroku CLI\nGo [here](https://devcenter.heroku.com/articles/heroku-cli) to install the Heroku CLI!\n\nIf you are on linux, you can just run:\n```sh\ncurl https://cli-assets.heroku.com/install.sh | sh\n```\n\n## Login to Heroku CLI\nIn your terminal, run the following.\n```\nheroku login\n```\nPress any key and it will open up your browser. Press the Log In button to link to your terminal.\n\n## Create your new App\nGo to your [dashboard](https://dashboard.heroku.com/apps) and click `Create New App`\n\n*(if you don't see this, look in top right for `New` and the dropdown will have `Create New App`)*\n\n## Lets do some coding\n\nWe'll be using [Express](https://expressjs.com/) and [Node.js](https://nodejs.org/en/). If you don't know what this is, we did a lesson on it a few weeks back. You can find the tutorial [here](https://github.com/hacksu/express-tutorial), and it has all the install instructions and in-depth explanations of Express and Node.js\n\n\nLets start by making a new folder.\n```\nmkdir my-heroku-app\ncd my-heroku-app\n```\n\nInitialize our Project\n```\n# Create Git Repo\ngit init\n\n# .gitignore\necho 'node_modules' \u003e .gitignore\n\n# Create empty project\nnpm init -y\n\n# Install express\nnpm install --save express\n\n# Create a root file for our project\necho \u003e index.js\n```\n\n(Here is all of that but in a single command so you can copy paste)\n```\ngit init \u0026\u0026 echo 'node_modules' \u003e .gitignore \u0026\u0026 npm init -y \u0026\u0026 npm install --save express \u0026\u0026 echo \u003e index.js\n```\n\nNext, we need to open `package.json` which should be inside our new folder.\n\n\nWe want to add `\"start\": \"node index.js\",` inside of `scripts`:\n```js\n{\n  /* ... other stuff .. */\n  \"scripts\": {\n    \"start\": \"node index.js\", // Add this line WITH A TRAILING COMMA\n    \"test\": \"node tests\"\n  },\n  /* ... other stuff ... */\n}\n```\n\nAlright, we got everything we need. Lets make a simple express app.\n\nindex.js\n```js\nlet express = require('express');\nlet app = express();\n\napp.get('/', (req, res) =\u003e res.send('Hello there!'))\n\nlet port = process.env.PORT || 8080; // Heroku will supply a port number for us through environment variables.\napp.listen(port, () =\u003e console.log(`Listening on port ${port}`));\n\n```\n\n## Test our Express app locally\n`npm run start`\n\nIf we visit https://localhost:8080 it should say `Hello there!`\n\nIf that works, lets commit our changes.\n```\ngit add . \u0026\u0026 git commit -m \"First Commit\"\n```\n\n## Deploying to Heroku\n\nAdd Heroku's remote\n```\n# replace \"hacksu-seitz-fall2020\" with whatever you named your app on your heroku daskboard.\nheroku git:remote -a hacksu-seitz-fall2020\n```\n\nDeploying\n```\ngit push heroku master\n```\n\nThat will do a lot of output, and once it finishes you can go visit your app!\n\nThere is an `Open App` button on the top right of your management page for your app. Just go to your [dashboard](https://dashboard.heroku.com/apps) and click your app, then click `Open App` in the top right.\n\n`https://{PROJECT NAME}.herokuapp.com/`\n\n## Alright, what about a custom domain name?\nThe details on how to add a custom domain name to heroku are [here](https://devcenter.heroku.com/articles/custom-domains)\n\n\n\nFirst, you need to have a domain name. I'd recommend buying one from [Namecheap](https://namecheap.com)\n\n\n**AS A STUDENT, YOU ALSO GAIN ACCESS TO THE GITHUB STUDENT DEVELOPER PACK**\nhttps://education.github.com/pack?sort=popularity\u0026tag=Domains\n\nYou can get a **FREE** 1 year .me domain from Namecheap through this.\n\n\n## Verify our account\n\nIn order to add a custom domain, we must verify our heroku account. You need to add a credit card to your account on your [billing page](https://dashboard.heroku.com/account/billing). I've already done this step.\n\nAdding your domain to heroku is free, they just want to verify you are a real person.\n\n## Adding the domain\n\n```\nheroku domains:add mydomainname.com\n```\n\nIt'll spit out a **DNS Target**, ending in `.herokudns.com`. Log in to your DNS provider and add a **CNAME Record** that points to the DNS Target Heroku provides you.\n\nI'd recommend using CloudFlare for DNS, its pretty great.\n\nHowever, we won't be covering domains and DNS in this lesson.\n\nAfter doing this, you should be able to visit your heroku app via your own domain name!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhacksu%2Fheroku-lesson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhacksu%2Fheroku-lesson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhacksu%2Fheroku-lesson/lists"}