deploying with heroku

2021-11-06

 | 

~1 min read

 | 

187 words

Quick and dirty notes on getting a node app up and running on Heroku:

  1. Download the CLI

  2. Login to Heroku

  3. Push your code up to Heroku — you can also connect GitHub to Heroku

    The nice thing about this is that it means you can iterate on your application quickly without necessarily changing your main remote repository (e.g., GitHub). This is because you would have two different remotes (origin by tradition and heroku for Heroku). However, Heroku will only build main/master branches, so it’s difficult to let the two remotes get out of sync with one another unintentionally.

  4. If it’s a Typescript project, be sure to handle that — the simple solution I came up with was to make sure it was built and then my start script pointed to the built entry point.

With all of that in place, once I’ve pushed the code using the Heroku CLI, I can hit my server using httpie:

There’s so much to improve about this process, but at a minimum - I now have a simple server running that’s accessible from anywhere.



Hi there and thanks for reading! My name's Stephen. I live in Chicago with my wife, Kate, and dog, Finn. Want more? See about and get in touch!