Awesome Node.js development environment with Heroku and Cloud9

As we know,Heroku enables developers to build and run Node.js apps on it,and the most important,it is FREE.
Today I will try to setup an awesome Node.js development environment and deployment with Cloud9 and Heroku.

Of course, we need to sign up first.

1.Sign up

1.https://c9.io/
2.https://www.heroku.com

2.Create a new App in heroku

Create a new App with an unique App name such as “myapp”,then we will have a public domain : https://myapp.herokuapp.com. heroku-1 heroku-2 heroku-3

3.Create a new Node.js Workspace in Cloud9

Cloud9 Workspace node dev   Cloud9

4.Remove unuseful libraries via Console

node dev Cloud9 uninstall

5.Edit the main script file

Change “server.js” to “app.js” with the following source code.

6.Edit package.json

The Heroku Node.js buildpack is employed when the application has either a package.json file or a server.js file in the root directory.
Edit “package.json” file with the following source code.

7.Create Procfile file

The command in Procfile that will be executed when a dyno is started.
Create “Procfile” file with the following source code.

8.Deploy

The last work, Deploy the whole files to Heroku via Console. node dev  Cloud9 resources
The message “Verifying deploy…. done.” will be shown if the Deploy is done,
then we can see the “Hello World” from the public domain https://myapp.herokuapp.com. heroku Hello World I will share you more infomation about Node.js and Heroku in the next posts,
Enjoy it!

Related Post

Write Apex Test Classes efficiently with Tesforce 1.Why Tesforce The Test Classes are required to deploy Apex to a production environment or to be packaged and placed on Force.com AppExchange, it must provide at least 75% code coverage. That will be a huge workload to SFDC Developers if the project(application) include a lot of Apex Classes,the...
Synchronize data between Postgres and Salesforce v... Somtimes we need to built a Web App with standard open source stacks, like PHP, Node.js and Python,but manage and analytic data with Salesforce standard functions,like record CRUD,views and reports. Heroku Connect provides us a pretty simple solution for this case, that using bi-directional syn...
Write a Heroku Scheduler batch for MangoDB+Salesfo... In previous post,I had shared how to 《Access Salesforce data via APIs(JSForce) from Outside Service》. In this post I will share about how to write a Heroku Scheduler batch for synchronizing MangoDB data to Salesforce with Node.js, like the below outline picture. ※I have no doubt that there hav...
Encrypte & Decrypte string in Node.js I have tried to encrypte and decrypte string in Node.js recently. There has many code examples at Internet, eg: Reference:http://qiita.com/sckm/items/232914af2959eefe505e https://gist.github.com/5db74af24c4ee31a3100 Run it in console commond but the following error has occurred. https://gis...

Post Tagged with , , ,