Over a million developers have joined DZone.

Mastering Heroku App Deployments with Node.js

· Cloud Zone

Download this eBook outlining the critical components of success for SaaS companies - and the new rules you need to play by.  Brought to you in partnership with NuoDB.

After some months developing with node.js, now is the time to deploy these apps and see which problems appear.

For the first two apps I decided to go with Heroku (although in a previous posts I commented that maybe Amazon was a better option). and here I’m showing you some of the commands I’ve been using on the deployment to make it easier for you:

Of course, you must install heroku toolbelt.

The first commands you must use are:

heroku login
heroku create

With these two commands, you will log in heroku and create the app.

After this, you can upload your apps to heroku automatically with git (so first, install git!):

git push heroku master

The reason I’m writing this article is mostly because I had a problem, and heroku origin got wrong. After that, I couldn’t upload heroku apps. I could create another app, and point my domain to the new app… but that’s starting all over again, and having an empty database.

So, what could you do to solve it? First of all, you have to list all your heroku apps to select the one you want to point to:

heroku list

If you cannot retrieve this info from the command line tools, you can access heroku web and log in to watch this information.

Once you know your app name you can configure git to access your heroku app. First remove you last heroku remote origin, and then add the new one:

git remote rm heroku
git remote add heroku git@heroku.com:.git

Now that you’ve configured your heroku app, you can show your heroku app info:

heroku info

 

 

 

Learn how moving from a traditional, on-premises delivery model to a cloud-based, software-as-a-service (SaaS) strategy is a high-stakes, bet-the-company game for independent software vendors. Brought to you in partnership with NuoDB.

Topics:

Published at DZone with permission of Javier Manzano, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}