Friday, May 16, 2014

Ten minutes to create a node.js based album on BlueMix (Part One)

Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications.Now most paas support Node.js runtime env.Node.js has now became the most popular choice for building Real-time Web Applications since it’s first release on May 27, 2009.Now BlueMix host nodejs for developer to use.Today I will talk about how to write  my albumn application based on node.js and deploy on the bluemix.

Setup Node.js IDE

If you are a java developer, I recommend you to use Eclipse. Nodeclipse plug-in is free open-source software released every month and it became #1 in Eclipse Top 10 NEW Plugins for 2013.You can install it through the eclipse(http://www.nodeclipse.org/updates).You can also download the node.js eclipse version from this link.When you finish the plug-in installation,you should see the below screenshot.


Now we will build the app, we'll use the Express.js framework ,use nodeeclipse we can easily to create a sample project for that.Here we choose jade as our template engine.

When you click the finish button,it will automatic download the express,jade module and also create express project structure.

Choose the app.js and right click the menu and run as node application.You will see below screenshot.



Notes: there is a issue in layout.jade.You need to manually change it.
doctype 5  //you need to change doctype htnl
html
  head
    title= title
    link(rel='stylesheet', href='/stylesheets/style.css')
  body
    block content

Next part  I will focus on how to write a node.js application with bootstrap to create my Album.



1 comment: