Deploy Node.js application in Heroku using Eclipse

1,899 views

Published on

Deploy Node.js application in Heroku using Eclipse

Published in: Software
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,899
On SlideShare
0
From Embeds
0
Number of Embeds
788
Actions
Shares
0
Downloads
16
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Deploy Node.js application in Heroku using Eclipse

  1. 1. Jitendra Zaa
  2. 2. Youtube Video URL  http://youtu.be/jVkG9Kb07fc
  3. 3. Tools and Technology  Language – Node.js  Platform – Heroku  Git – Bitbucket using SSH key  IDE – Eclipse  Eclipse Plugins  Egit  Heroku  NodeEclipse
  4. 4. Setup Bitbucket (Optional)
  5. 5. 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.
  6. 6. Introduction to EGit  Check this article :  http://www.shivasoft.in/blog/salesforce/salesforce-git- eclipse-egit-better-and-distributed-source-control/
  7. 7. Introduction to Heroku Plugin  Check this –  http://www.shivasoft.in/blog/java/creating-first- application-in-heroku-using-eclipse/
  8. 8. 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
  9. 9. 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); });
  10. 10. 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
  11. 11. Create Package.json  Add below entry in generated package.json { "engines": { "node": "0.10.x" } }
  12. 12. Create Procfile Only one line needs to enter web: node Web.js
  13. 13. Commit to Git  First Commit to Local  Then  Heroku
  14. 14. 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
  15. 15. How to check logs on Heroku  Navigate to your Node.js application folder and run below command :  Heroku logs
  16. 16. Test your application Thanks

×