SlideShare a Scribd company logo
1 of 35
Download to read offline
NodeJS
           JS as a Server-side Language

           Iraj Islam @irajislam
           Nurul Ferdous @ferdous


                    NewsCred

Saturday, September 17, 2011
Agenda                                 NewsCred




                   •       Part 1. NodeJS

                   •       Part 2. ExpressJS

                   •       Questions?




Saturday, September 17, 2011
Who We Are                                   NewsCred




                Iraj Islam
                CTO/Co-founder, NewsCred


                Nurul Ferdous
                Senior Software Engineer, NewsCred




Saturday, September 17, 2011
Part 1
           NodeJS


                    NewsCred


Saturday, September 17, 2011
Server-side JS         NewsCred




Saturday, September 17, 2011
What’s NodeJS?                                  NewsCred




                                 NodeJS
                               What’s this all about?




Saturday, September 17, 2011
What’s NodeJS?                                      NewsCred




                                      NodeJS
                               Evented I/O for V8 JavaScript.




Saturday, September 17, 2011
What’s NodeJS?                            NewsCred




                               Goal
                 “Provide an easy way to build scalable
                         network programs.”




Saturday, September 17, 2011
History                                                       NewsCred


                               The Evolution of the Web
                               From static pages to real time data.




Saturday, September 17, 2011
Why NodeJS?                                                           NewsCred


                                      The Age of Big Data
                                Exabytes (1018) of data stored per year

                                                                        1000



                                                                        750


                                                                     500


                                                                    250
                               2006
                                      2007
                                             2008                   0
                                                    2009
                                                            2010


Saturday, September 17, 2011
Why NodeJS?                                           NewsCred


                               The Fast Food Analogy
                               Synchronous vs. Asynchronous




Saturday, September 17, 2011
Why NodeJS?                                   NewsCred


                               The Apache Solution
                                Synchronous I/O
                                  Application

                                                        File
                User                    readFile();    System




                                       getTweets();    Twitter
                                                        API




                                      writeToDb();     MySQL


Saturday, September 17, 2011
Why NodeJS?                                   NewsCred


                               The Apache Solution
                                  Blocking I/O
                                  Application

                                                        File
                User                    readFile();    System


                                        Waiting...

                                       getTweets();    Twitter
                                                        API

                                        Waiting...

                                      writeToDb();     MySQL


Saturday, September 17, 2011
Why NodeJS?                                   NewsCred


                               The NodeJS Solution
                                Asynchronous I/O
                                  Application

                                                        File
                User                    readFile();    System




                                       getTweets();    Twitter
                                                        API




                                      writeToDb();     MySQL


Saturday, September 17, 2011
Why NodeJS?                                   NewsCred


                               The NodeJS Solution
                                Non-blocking I/O
                                  Application

                                                        File
                User                    readFile();    System




                                       getTweets();    Twitter
                                                        API




                                      writeToDb();     MySQL


Saturday, September 17, 2011
NodeJS Benefits                                                       NewsCred




                  • Fast
                        • Built on top of Google’s V8 JavaScript engine.


                  • Scalable
                        • Asynchronous, event-driven I/O model yields web scale.


                  • Programmable
                        • JavaScript API and pluggable module architecture.




Saturday, September 17, 2011
NodeJS Use Cases                   NewsCred




                • Serving APIs
                • Serving real-time apps
                • Serving web apps
                • Streaming data




Saturday, September 17, 2011
NodeJS “Hello World!”                          NewsCred




           var http = require('http');

           http.createServer(function (request, response) {
             response.writeHead(200, {'Content-Type':
                                      'text/plain'});
             response.writeHead('Hello World!');
           }).listen(1337, '127.0.0.1');




Saturday, September 17, 2011
Who’s Using NodeJS?    NewsCred




Saturday, September 17, 2011
Installing NodeJS                                              NewsCred



                  • Installing on Unix




                  • Installing on Windows
                        • Run http://nodejs.org/dist/v0.5.6/node.exe



Saturday, September 17, 2011
Installing npm                                                     NewsCred




                  • Node Package Manager (npm)

                  • One line install:
                        • curl http://npmjs.org/install.sh | sudo sh


                  • Multi-line install:
                        • Get the code from http://github.com/isaacs/npm
                        • Do what the REAMME says




Saturday, September 17, 2011
Part 2
           ExpressJS


                    NewsCred


Saturday, September 17, 2011
What’s ExpressJS?                                NewsCred




                                 ExpressJS
                               High-performance NodeJS
                                    web framework.




Saturday, September 17, 2011
Why ExpressJS?                                NewsCred




                  • Full blown feature set
                        • Routing
                        • View rendering/templating
                        • Sessions


                  • Good documentation
                        • Lots of examples


                  • Many extensions


Saturday, September 17, 2011
Installing ExpressJS   NewsCred




Saturday, September 17, 2011
Directory Structure    NewsCred




Saturday, September 17, 2011
Configuration          NewsCred




Saturday, September 17, 2011
Application Settings   NewsCred




Saturday, September 17, 2011
Routing                NewsCred




Saturday, September 17, 2011
View Rendering                                    NewsCred



                  • Haml templates
                        • Haml
                        • Jade


                  • Embedded JavaScript (EJS) templates

                  • Coffeekup templates
                        • Uses CoffeeScript


                  • jQuery templates

Saturday, September 17, 2011
Views with Jade        NewsCred




Saturday, September 17, 2011
Sessions                                                 NewsCred


                  • Currently cookie-based
                        • Data store can be Redis, memory etc.




Saturday, September 17, 2011
Packages                                  NewsCred




         $ npm install -d # for installing dependancies

Saturday, September 17, 2011
Resources                                                       NewsCred




                  • NodeJS
                        • http://nodejs.org
                        • http://github.com/dynamicguy/node-mongo-cms


                  • ExpressJS
                        • http://expressjs.com


                  • Sencha Connect
                        • http://github.com/senchalabs/connect/wiki




Saturday, September 17, 2011
Questions?                              NewsCred




                Iraj Islam
                iraj@newscred.com, @irajislam


                Nurul Ferdous
                nurul@newscred.com, @ferdous




Saturday, September 17, 2011

More Related Content

What's hot

What's hot (20)

Introduction to node.js
Introduction to node.jsIntroduction to node.js
Introduction to node.js
 
Complete MVC on NodeJS
Complete MVC on NodeJSComplete MVC on NodeJS
Complete MVC on NodeJS
 
Nodejs getting started
Nodejs getting startedNodejs getting started
Nodejs getting started
 
Introduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azureIntroduction to node js - From "hello world" to deploying on azure
Introduction to node js - From "hello world" to deploying on azure
 
Nodejs
NodejsNodejs
Nodejs
 
Introduction to Node js
Introduction to Node jsIntroduction to Node js
Introduction to Node js
 
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...
 
NodeJS ecosystem
NodeJS ecosystemNodeJS ecosystem
NodeJS ecosystem
 
Best node js course
Best node js courseBest node js course
Best node js course
 
Node.js tutoria for beginner
Node.js tutoria for beginnerNode.js tutoria for beginner
Node.js tutoria for beginner
 
Use Node.js to create a REST API
Use Node.js to create a REST APIUse Node.js to create a REST API
Use Node.js to create a REST API
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 
Introduction to node.js
Introduction to node.jsIntroduction to node.js
Introduction to node.js
 
What is Node.js | Node.js Tutorial for Beginners | Node.js Modules | Node.js ...
What is Node.js | Node.js Tutorial for Beginners | Node.js Modules | Node.js ...What is Node.js | Node.js Tutorial for Beginners | Node.js Modules | Node.js ...
What is Node.js | Node.js Tutorial for Beginners | Node.js Modules | Node.js ...
 
Introduction to node.js GDD
Introduction to node.js GDDIntroduction to node.js GDD
Introduction to node.js GDD
 
Basic Concept of Node.js & NPM
Basic Concept of Node.js & NPMBasic Concept of Node.js & NPM
Basic Concept of Node.js & NPM
 
3 Things Everyone Knows About Node JS That You Don't
3 Things Everyone Knows About Node JS That You Don't3 Things Everyone Knows About Node JS That You Don't
3 Things Everyone Knows About Node JS That You Don't
 
Nodejs presentation
Nodejs presentationNodejs presentation
Nodejs presentation
 
Fundamental of Node.JS - Internship Presentation - Week7
Fundamental of Node.JS - Internship Presentation - Week7Fundamental of Node.JS - Internship Presentation - Week7
Fundamental of Node.JS - Internship Presentation - Week7
 
Node js training (1)
Node js training (1)Node js training (1)
Node js training (1)
 

Viewers also liked

How to scale and deploy NodeJS app
How to scale and deploy NodeJS appHow to scale and deploy NodeJS app
How to scale and deploy NodeJS app
Yacobus Reinhart
 
Nodejs introduce - using Socket.io
Nodejs introduce - using Socket.ioNodejs introduce - using Socket.io
Nodejs introduce - using Socket.io
Caesar Chi
 
Java script at backend nodejs
Java script at backend   nodejsJava script at backend   nodejs
Java script at backend nodejs
Amit Thakkar
 
Asynchronous I/O in NodeJS - new standard or challenges?
Asynchronous I/O in NodeJS - new standard or challenges?Asynchronous I/O in NodeJS - new standard or challenges?
Asynchronous I/O in NodeJS - new standard or challenges?
Dinh Pham
 

Viewers also liked (16)

NodeJS
NodeJSNodeJS
NodeJS
 
How to scale and deploy NodeJS app
How to scale and deploy NodeJS appHow to scale and deploy NodeJS app
How to scale and deploy NodeJS app
 
Nodejs introduce - using Socket.io
Nodejs introduce - using Socket.ioNodejs introduce - using Socket.io
Nodejs introduce - using Socket.io
 
Nimrod: MongoDB Shell in NodeJS (JSConfUY 2015)
Nimrod: MongoDB Shell in NodeJS (JSConfUY 2015)Nimrod: MongoDB Shell in NodeJS (JSConfUY 2015)
Nimrod: MongoDB Shell in NodeJS (JSConfUY 2015)
 
Java script at backend nodejs
Java script at backend   nodejsJava script at backend   nodejs
Java script at backend nodejs
 
High Performance NodeJS
High Performance NodeJSHigh Performance NodeJS
High Performance NodeJS
 
Asynchronous I/O in NodeJS - new standard or challenges?
Asynchronous I/O in NodeJS - new standard or challenges?Asynchronous I/O in NodeJS - new standard or challenges?
Asynchronous I/O in NodeJS - new standard or challenges?
 
NodeJS guide for beginners
NodeJS guide for beginnersNodeJS guide for beginners
NodeJS guide for beginners
 
Nodejs Event Driven Concurrency for Web Applications
Nodejs Event Driven Concurrency for Web ApplicationsNodejs Event Driven Concurrency for Web Applications
Nodejs Event Driven Concurrency for Web Applications
 
Create Rest API in Nodejs
Create Rest API in Nodejs Create Rest API in Nodejs
Create Rest API in Nodejs
 
All aboard the NodeJS Express
All aboard the NodeJS ExpressAll aboard the NodeJS Express
All aboard the NodeJS Express
 
Workshop 4: NodeJS. Express Framework & MongoDB.
Workshop 4: NodeJS. Express Framework & MongoDB.Workshop 4: NodeJS. Express Framework & MongoDB.
Workshop 4: NodeJS. Express Framework & MongoDB.
 
NodeJS for Beginner
NodeJS for BeginnerNodeJS for Beginner
NodeJS for Beginner
 
Nodejs Explained with Examples
Nodejs Explained with ExamplesNodejs Explained with Examples
Nodejs Explained with Examples
 
All about NodeJS
All about NodeJSAll about NodeJS
All about NodeJS
 
Express node js
Express node jsExpress node js
Express node js
 

Similar to JavaScript as a Server side language (NodeJS): JSConf 2011, Dhaka

Open End To End Js Stack
Open End To End Js StackOpen End To End Js Stack
Open End To End Js Stack
Skills Matter
 
Building businesspost.ie using Node.js
Building businesspost.ie using Node.jsBuilding businesspost.ie using Node.js
Building businesspost.ie using Node.js
Richard Rodger
 
JavaOne 2011 - Going Mobile With Java Based Technologies Today
JavaOne 2011 - Going Mobile With Java Based Technologies TodayJavaOne 2011 - Going Mobile With Java Based Technologies Today
JavaOne 2011 - Going Mobile With Java Based Technologies Today
Wesley Hales
 

Similar to JavaScript as a Server side language (NodeJS): JSConf 2011, Dhaka (20)

LoopBack: a productivity booster for MEAN
LoopBack: a productivity booster for MEANLoopBack: a productivity booster for MEAN
LoopBack: a productivity booster for MEAN
 
Lib uv node.js
Lib uv node.js Lib uv node.js
Lib uv node.js
 
Introduction to NodeJS
Introduction to NodeJSIntroduction to NodeJS
Introduction to NodeJS
 
Open End To End Js Stack
Open End To End Js StackOpen End To End Js Stack
Open End To End Js Stack
 
Get Lean with OSEE
Get Lean with OSEEGet Lean with OSEE
Get Lean with OSEE
 
Flowdock's full-text search with MongoDB
Flowdock's full-text search with MongoDBFlowdock's full-text search with MongoDB
Flowdock's full-text search with MongoDB
 
Meanstack overview
Meanstack overviewMeanstack overview
Meanstack overview
 
GENIVI + OCF Cooperation
GENIVI + OCF CooperationGENIVI + OCF Cooperation
GENIVI + OCF Cooperation
 
Node.JS briefly introduced
Node.JS briefly introducedNode.JS briefly introduced
Node.JS briefly introduced
 
Building businesspost.ie using Node.js
Building businesspost.ie using Node.jsBuilding businesspost.ie using Node.js
Building businesspost.ie using Node.js
 
Solid NodeJS with TypeScript, Jest & NestJS
Solid NodeJS with TypeScript, Jest & NestJSSolid NodeJS with TypeScript, Jest & NestJS
Solid NodeJS with TypeScript, Jest & NestJS
 
Node at artsy
Node at artsyNode at artsy
Node at artsy
 
MEAN Stack - Google Developers Live 10/03/2013
MEAN Stack - Google Developers Live 10/03/2013MEAN Stack - Google Developers Live 10/03/2013
MEAN Stack - Google Developers Live 10/03/2013
 
JavaOne 2011 - Going Mobile With Java Based Technologies Today
JavaOne 2011 - Going Mobile With Java Based Technologies TodayJavaOne 2011 - Going Mobile With Java Based Technologies Today
JavaOne 2011 - Going Mobile With Java Based Technologies Today
 
Building Applications With the MEAN Stack
Building Applications With the MEAN StackBuilding Applications With the MEAN Stack
Building Applications With the MEAN Stack
 
Developing realtime apps with Drupal and NodeJS
Developing realtime apps with Drupal and NodeJS Developing realtime apps with Drupal and NodeJS
Developing realtime apps with Drupal and NodeJS
 
Node.js and Enterprise Web Apps: Know all About it
Node.js and Enterprise Web Apps: Know all About itNode.js and Enterprise Web Apps: Know all About it
Node.js and Enterprise Web Apps: Know all About it
 
IPTC News in JSON November 2017
IPTC News in JSON November 2017IPTC News in JSON November 2017
IPTC News in JSON November 2017
 
Meteoro de pegasuus! Desenvolvendo aplicações realtime com MeteorJS
Meteoro de pegasuus! Desenvolvendo aplicações realtime com MeteorJSMeteoro de pegasuus! Desenvolvendo aplicações realtime com MeteorJS
Meteoro de pegasuus! Desenvolvendo aplicações realtime com MeteorJS
 
The Happy Path: Migration Strategies for Node.js
The Happy Path: Migration Strategies for Node.jsThe Happy Path: Migration Strategies for Node.js
The Happy Path: Migration Strategies for Node.js
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Recently uploaded (20)

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 

JavaScript as a Server side language (NodeJS): JSConf 2011, Dhaka

  • 1. NodeJS JS as a Server-side Language Iraj Islam @irajislam Nurul Ferdous @ferdous NewsCred Saturday, September 17, 2011
  • 2. Agenda NewsCred • Part 1. NodeJS • Part 2. ExpressJS • Questions? Saturday, September 17, 2011
  • 3. Who We Are NewsCred Iraj Islam CTO/Co-founder, NewsCred Nurul Ferdous Senior Software Engineer, NewsCred Saturday, September 17, 2011
  • 4. Part 1 NodeJS NewsCred Saturday, September 17, 2011
  • 5. Server-side JS NewsCred Saturday, September 17, 2011
  • 6. What’s NodeJS? NewsCred NodeJS What’s this all about? Saturday, September 17, 2011
  • 7. What’s NodeJS? NewsCred NodeJS Evented I/O for V8 JavaScript. Saturday, September 17, 2011
  • 8. What’s NodeJS? NewsCred Goal “Provide an easy way to build scalable network programs.” Saturday, September 17, 2011
  • 9. History NewsCred The Evolution of the Web From static pages to real time data. Saturday, September 17, 2011
  • 10. Why NodeJS? NewsCred The Age of Big Data Exabytes (1018) of data stored per year 1000 750 500 250 2006 2007 2008 0 2009 2010 Saturday, September 17, 2011
  • 11. Why NodeJS? NewsCred The Fast Food Analogy Synchronous vs. Asynchronous Saturday, September 17, 2011
  • 12. Why NodeJS? NewsCred The Apache Solution Synchronous I/O Application File User readFile(); System getTweets(); Twitter API writeToDb(); MySQL Saturday, September 17, 2011
  • 13. Why NodeJS? NewsCred The Apache Solution Blocking I/O Application File User readFile(); System Waiting... getTweets(); Twitter API Waiting... writeToDb(); MySQL Saturday, September 17, 2011
  • 14. Why NodeJS? NewsCred The NodeJS Solution Asynchronous I/O Application File User readFile(); System getTweets(); Twitter API writeToDb(); MySQL Saturday, September 17, 2011
  • 15. Why NodeJS? NewsCred The NodeJS Solution Non-blocking I/O Application File User readFile(); System getTweets(); Twitter API writeToDb(); MySQL Saturday, September 17, 2011
  • 16. NodeJS Benefits NewsCred • Fast • Built on top of Google’s V8 JavaScript engine. • Scalable • Asynchronous, event-driven I/O model yields web scale. • Programmable • JavaScript API and pluggable module architecture. Saturday, September 17, 2011
  • 17. NodeJS Use Cases NewsCred • Serving APIs • Serving real-time apps • Serving web apps • Streaming data Saturday, September 17, 2011
  • 18. NodeJS “Hello World!” NewsCred var http = require('http'); http.createServer(function (request, response) { response.writeHead(200, {'Content-Type': 'text/plain'}); response.writeHead('Hello World!'); }).listen(1337, '127.0.0.1'); Saturday, September 17, 2011
  • 19. Who’s Using NodeJS? NewsCred Saturday, September 17, 2011
  • 20. Installing NodeJS NewsCred • Installing on Unix • Installing on Windows • Run http://nodejs.org/dist/v0.5.6/node.exe Saturday, September 17, 2011
  • 21. Installing npm NewsCred • Node Package Manager (npm) • One line install: • curl http://npmjs.org/install.sh | sudo sh • Multi-line install: • Get the code from http://github.com/isaacs/npm • Do what the REAMME says Saturday, September 17, 2011
  • 22. Part 2 ExpressJS NewsCred Saturday, September 17, 2011
  • 23. What’s ExpressJS? NewsCred ExpressJS High-performance NodeJS web framework. Saturday, September 17, 2011
  • 24. Why ExpressJS? NewsCred • Full blown feature set • Routing • View rendering/templating • Sessions • Good documentation • Lots of examples • Many extensions Saturday, September 17, 2011
  • 25. Installing ExpressJS NewsCred Saturday, September 17, 2011
  • 26. Directory Structure NewsCred Saturday, September 17, 2011
  • 27. Configuration NewsCred Saturday, September 17, 2011
  • 28. Application Settings NewsCred Saturday, September 17, 2011
  • 29. Routing NewsCred Saturday, September 17, 2011
  • 30. View Rendering NewsCred • Haml templates • Haml • Jade • Embedded JavaScript (EJS) templates • Coffeekup templates • Uses CoffeeScript • jQuery templates Saturday, September 17, 2011
  • 31. Views with Jade NewsCred Saturday, September 17, 2011
  • 32. Sessions NewsCred • Currently cookie-based • Data store can be Redis, memory etc. Saturday, September 17, 2011
  • 33. Packages NewsCred $ npm install -d # for installing dependancies Saturday, September 17, 2011
  • 34. Resources NewsCred • NodeJS • http://nodejs.org • http://github.com/dynamicguy/node-mongo-cms • ExpressJS • http://expressjs.com • Sencha Connect • http://github.com/senchalabs/connect/wiki Saturday, September 17, 2011
  • 35. Questions? NewsCred Iraj Islam iraj@newscred.com, @irajislam Nurul Ferdous nurul@newscred.com, @ferdous Saturday, September 17, 2011