Hosting Node.js application on the cloud using Nodejitsu


In this post I will walk through step by step to host your first node application on the cloud. I will be doing this exercise using Nodejitsu which is pretty awesome in my opinion.
1)      Create a username and register your email.
2)      Once you have registered an automated email is sent to your email.
3)      Open the command prompt and verify the account using :
a.       “npm install jitsu –g” (Installs Jitsu globally)
b.      The next command needs to be copied from your email. In my example I have it as : “jitsu users confirm nav1 42825350-1536-48db-830b-739d7c6a33ad” (Verifies the account created)
4)      On the command prompt you will be asked for the jitsu login and password that you have just created. Once you are authenticated, you are all set to rock on the cloud.
5)      Please read my post hereif you are unaware to create a simple node application.
6)      “cd project root dir”
7)      Ensure your application is running with all dependent modules locally and on browser.
8)      “jitsu deploy” à Deploys the application to the cloud.
9)      Enter the subdomain of your choice on the cmd prompt when prompted –-> eg: “testdomain”
10)   Key in the nonde version when prompted that you require on the cloud.
11)   Verify your package.json when prompted. This file will be used on the cloud to install your dependent modules.
12)   Ensure the syntax is correct in package.json or you will have failed deployment.
Eg:

{
  "name": "application-name",
  "version": "0.0.1-2",
  "private": true,
  "scripts": {
    "start": "node app.js"
  },
  "dependencies": {
    "express": "3.0.5",
    "jade": "*"
  },
  "subdomain": "mytestdomain",
  "engines": {
    "node": "0.8.x"
  }
}

14)   Login with your username and password, you will see your application in active state.
16)   You will see your application consumed from the cloud.
17)   I personally recommend Nodejitsu for the quality support, cost effective on number of drones and applications per drone.

Hope this post helps you to host your first node.js application on the cloud.

1 comment: