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

Complete MVC on NodeJS
Complete MVC on NodeJSComplete MVC on NodeJS
Complete MVC on NodeJSHüseyin BABAL
 
Nodejs getting started
Nodejs getting startedNodejs getting started
Nodejs getting startedTriet Ho
 
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 azureColin Mackay
 
Introduction to Node js
Introduction to Node jsIntroduction to Node js
Introduction to Node jsAkshay Mathur
 
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...Edureka!
 
NodeJS ecosystem
NodeJS ecosystemNodeJS ecosystem
NodeJS ecosystemYukti Kaura
 
Node.js tutoria for beginner
Node.js tutoria for beginnerNode.js tutoria for beginner
Node.js tutoria for beginnerManinder Singh
 
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 APIFabien Vauchelles
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.jsVikash Singh
 
Introduction to node.js
Introduction to node.jsIntroduction to node.js
Introduction to node.jsDinesh U
 
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 ...Edureka!
 
Introduction to node.js GDD
Introduction to node.js GDDIntroduction to node.js GDD
Introduction to node.js GDDSudar Muthu
 
Basic Concept of Node.js & NPM
Basic Concept of Node.js & NPMBasic Concept of Node.js & NPM
Basic Concept of Node.js & NPMBhargav Anadkat
 
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'tF5 Buddy
 
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 - Week7Devang Garach
 
Node js training (1)
Node js training (1)Node js training (1)
Node js training (1)Ashish Gupta
 

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 appYacobus Reinhart
 
Nodejs introduce - using Socket.io
Nodejs introduce - using Socket.ioNodejs introduce - using Socket.io
Nodejs introduce - using Socket.ioCaesar Chi
 
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)Valeri Karpov
 
Java script at backend nodejs
Java script at backend   nodejsJava script at backend   nodejs
Java script at backend nodejsAmit Thakkar
 
High Performance NodeJS
High Performance NodeJSHigh Performance NodeJS
High Performance NodeJSDicoding
 
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
 
NodeJS guide for beginners
NodeJS guide for beginnersNodeJS guide for beginners
NodeJS guide for beginnersEnoch Joshua
 
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 ApplicationsGanesh Iyer
 
Create Rest API in Nodejs
Create Rest API in Nodejs Create Rest API in Nodejs
Create Rest API in Nodejs Irfan Maulana
 
All aboard the NodeJS Express
All aboard the NodeJS ExpressAll aboard the NodeJS Express
All aboard the NodeJS ExpressDavid Boyer
 
Workshop 4: NodeJS. Express Framework & MongoDB.
Workshop 4: NodeJS. Express Framework & MongoDB.Workshop 4: NodeJS. Express Framework & MongoDB.
Workshop 4: NodeJS. Express Framework & MongoDB.Visual Engineering
 
Nodejs Explained with Examples
Nodejs Explained with ExamplesNodejs Explained with Examples
Nodejs Explained with ExamplesGabriele Lana
 

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

LoopBack: a productivity booster for MEAN
LoopBack: a productivity booster for MEANLoopBack: a productivity booster for MEAN
LoopBack: a productivity booster for MEANMiroslav Bajtoš
 
Lib uv node.js
Lib uv node.js Lib uv node.js
Lib uv node.js Ben Crox
 
Open End To End Js Stack
Open End To End Js StackOpen End To End Js Stack
Open End To End Js StackSkills Matter
 
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 MongoDBFlowdock
 
Building businesspost.ie using Node.js
Building businesspost.ie using Node.jsBuilding businesspost.ie using Node.js
Building businesspost.ie using Node.jsRichard Rodger
 
Solid NodeJS with TypeScript, Jest & NestJS
Solid NodeJS with TypeScript, Jest & NestJSSolid NodeJS with TypeScript, Jest & NestJS
Solid NodeJS with TypeScript, Jest & NestJSRafael Casuso Romate
 
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/2013Valeri Karpov
 
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 TodayWesley Hales
 
Building Applications With the MEAN Stack
Building Applications With the MEAN StackBuilding Applications With the MEAN Stack
Building Applications With the MEAN StackNir Noy
 
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 drupalcampest
 
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 itFibonalabs
 
IPTC News in JSON November 2017
IPTC News in JSON November 2017IPTC News in JSON November 2017
IPTC News in JSON November 2017Stuart Myles
 
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 MeteorJSJulio Antonio Mendonça de Marins
 
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.jsNicholas Jansma
 

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

TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 

Recently uploaded (20)

TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 

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