Jitendra Zaa
Youtube Video URL
 http://youtu.be/jVkG9Kb07fc
Tools and Technology
 Language – Node.js
 Platform – Heroku
 Git – Bitbucket using SSH key
 IDE – Eclipse
 Eclipse Plugins
 Egit
 Heroku
 NodeEclipse
Setup Bitbucket (Optional)
Setup SSH Key in Bitbucket and
Heroku
 Create RSA SSH Key from Eclipse.
 Save that key in BitBucket as well as Heroku.
 Explained in article link provided in next slides.
Introduction to EGit
 Check this article :
 http://www.shivasoft.in/blog/salesforce/salesforce-git-
eclipse-egit-better-and-distributed-source-control/
Introduction to Heroku Plugin
 Check this –
 http://www.shivasoft.in/blog/java/creating-first-
application-in-heroku-using-eclipse/
Creating Blank Heroku Application
 In Eclipse, Click on Create New Project
 And select Heroku, assuming you have already
installed Heroku plugin in Eclipse.
 Refer article explained in starting of this presentation
Create sample Node.js startup File
Create Web.js file with following code
var express = require("express");
var logfmt = require("logfmt");
var app = express();
app.use(logfmt.requestLogger());
app.get('/', function(req, res) {
res.send('Hello World!');
});
var port = Number(process.env.PORT || 5000);
app.listen(port, function() {
console.log("Listening on " + port);
});
Create Package.json
 Open root application path in console
 Run “npm init” command and provide all information
 Now run below command
 npm install express logfmt --save
Create Package.json
 Add below entry in generated package.json
{
"engines": {
"node": "0.10.x"
}
}
Create Procfile
Only one line needs to enter
web: node Web.js
Commit to Git
 First Commit to Local
 Then
 Heroku
Assign Dyno to your application
 A dyno is a lightweight container running a single
user-specified command
 Assign 1 Dyno to your Heroku application which is free
How to check logs on Heroku
 Navigate to your Node.js application folder and run
below command :
 Heroku logs
Test your application
Thanks

Deploy Node.js application in Heroku using Eclipse

  • 1.
  • 2.
    Youtube Video URL http://youtu.be/jVkG9Kb07fc
  • 3.
    Tools and Technology Language – Node.js  Platform – Heroku  Git – Bitbucket using SSH key  IDE – Eclipse  Eclipse Plugins  Egit  Heroku  NodeEclipse
  • 4.
  • 5.
    Setup SSH Keyin Bitbucket and Heroku  Create RSA SSH Key from Eclipse.  Save that key in BitBucket as well as Heroku.  Explained in article link provided in next slides.
  • 6.
    Introduction to EGit Check this article :  http://www.shivasoft.in/blog/salesforce/salesforce-git- eclipse-egit-better-and-distributed-source-control/
  • 7.
    Introduction to HerokuPlugin  Check this –  http://www.shivasoft.in/blog/java/creating-first- application-in-heroku-using-eclipse/
  • 8.
    Creating Blank HerokuApplication  In Eclipse, Click on Create New Project  And select Heroku, assuming you have already installed Heroku plugin in Eclipse.  Refer article explained in starting of this presentation
  • 9.
    Create sample Node.jsstartup File Create Web.js file with following code var express = require("express"); var logfmt = require("logfmt"); var app = express(); app.use(logfmt.requestLogger()); app.get('/', function(req, res) { res.send('Hello World!'); }); var port = Number(process.env.PORT || 5000); app.listen(port, function() { console.log("Listening on " + port); });
  • 10.
    Create Package.json  Openroot application path in console  Run “npm init” command and provide all information  Now run below command  npm install express logfmt --save
  • 11.
    Create Package.json  Addbelow entry in generated package.json { "engines": { "node": "0.10.x" } }
  • 12.
    Create Procfile Only oneline needs to enter web: node Web.js
  • 13.
    Commit to Git First Commit to Local  Then  Heroku
  • 14.
    Assign Dyno toyour application  A dyno is a lightweight container running a single user-specified command  Assign 1 Dyno to your Heroku application which is free
  • 15.
    How to checklogs on Heroku  Navigate to your Node.js application folder and run below command :  Heroku logs
  • 16.