In this article I show you how to automatically deploy a node.js app on heroku from the c9.io ide using heroku toolbet.
The contents of the article
- io and Heroku Toolbet
- Create your app on Heroku
- First deploy from c9.io
In this article I will tell you how to automatically deploy a node.js app on heroku using the cloud ide c9.io and the integrated heroku toolbet . Don’t know what c9.io is?
Then take a small step back, I suggest you read my article on c9.io, the free and collaborative cloud ide recently purchased from Amazon (AWS).
Back to us, I have been using c9.io for a long time and initially there was a graphical interface that allowed, in a visual way, to deploy a node.js app on Heroku .
Subsequently a new graphical interface was introduced and since then the visual tool is no longer available, so you will have to use the command line and the features made available to developers by Heroku itself through the Heroku Toolbelt .
c9.io and Heroku Toolbet
I give you good news, on c9.io the Heroku Toolbet is installed by default and allows you to manage the applications published on Heroku directly from the command line , also integrated with the ide .
This is a view of the cloud ide, on the left the tab to browse all files, the central part contains the editor for the source code and below there are the tabs for the linux shell (file system) and the shell for debugging .
First, then, log in to your ide cloud c9.io and open your node.js webapp , if you don’t know how to create a test node webapp I suggest you read this article .
YOU MAY BE INTERESTED IN …Deploy a node.js app on Heroku in Continuous Integration with gitHub
Consider that the Heroku deployment is now perfectly integrated with git so every push you push will result in an automatic deployment .
You can use Heroku itself as a git repository or connect your application to a gitHub or dropbox account , in all cases the push will result in an automatic deployment .
[sociallocker] [/ sociallocker]
Create your app on Heroku
In this article I will show you how to deploy using the git repository integrated with Heroku , the sequence of commands to run from the command line is this:
$ heroku auth: login
enter your Heroku email and password
Now create a new Heroku app with the command:
$ heroku apps: create by thinking
Replace thinkingit with the name you want to give your app.
A new app and related git repository will be created on Heroku, as shown in the figure:
The details of the new app will also be visible from your dashboard , while from the ” Settings ” tab under ” Heroku Git URL ” you will find the link of the new git repository.
This operation will only create the ” container ” of the app that you will need to deploy. To complete the deployment you will need to link your c9.io project with Heroku via git.
First deploy from c9.io
So, always from the command line, set the git repository:
$ git init
Then add the Heroku remote repository (link seen previously under ” Heroku Git URL “)
$ heroku git: remote -a [heroku git url]
Now add the files to git , commit and push :
$ git add.$ git commit -am “my first deploy”$ git push heroku master
The push will also determine the automatic deployment of the app.
The game is done! Your new app is deployed on Heroku and visible from the link: https: // [yourApp] .herokuapp.com