SlideShare a Scribd company logo
1 of 34
The new, new hotness.
Eventful JavaScript on the Server

           @dshaw
About.me/dshaw   Web Application Developer
                 WVU 2006, 2008
                 WVU ACM Treasurer
What’s your avor?   Java
                    Python
                             C / C++ / C#
                             Erlang / Haskell
                    Ruby     JavaScript
JavaScript, really?



•   Learning Javascript used to mean you weren't a
    "serious software developer". Today, not learning
    Javascript means the same thing.
                        - James Governor ( @monkchips )
•   http://twitter.com/monkchips/status/25217409319
The Hype   Hacker News <3’s Node.js
           “Everyone’s talking about it.”
GitHub   Node is the #3 most watched project
         on GitHub ...and moving fast.
Why is Node.js so hot?
Node’s Fast.   Non-blocking event driven architecture.
Your Fast!   Speed from idea to prototype to
             production.
Developer Satisfaction!   Love your code.
                           Love coding.
My Favorite Reason

  • JavaScript on the Client

      • JavaScript on the Server


                  = Fun!
Show Me Some Code!

var http = require('http');

http.createServer(function(req, res) {
  res.writeHead(200,
      {'Content-Type': 'text/plain'});
  res.write('Hello, Node.n');
  res.end();
}).listen(1337);

console.log('Server running on :1337');
“Hello, Node.” demo

http://github.com/Marak/hellonode/
var http = require('http');

 http.createServer(function(req, res) {
   res.writeHead(200,
       {'Content-Type': 'text/plain'});
   res.write('Hello, Node.n');
   res.end();
 }).listen(1337);

 console.log('Server running on :1337');




Essential Node.js                   You probably won’t spend too much time
                                    writing request/response code.
var http = require('http');

 http.createServer(function(req, res) {
   res.writeHead(200,
       {'Content-Type': 'text/plain'});
   res.write('Hello, Node.n');
   res.end();
 }).listen(1337);

 console.log('Server running on :1337');




Essential Node.js                   Don’t cheat yourself.
                                     You need to spend some time though.
Require
 var http = require('http');

 http.createServer(function(req, res) {
   res.writeHead(200,
       {'Content-Type': 'text/plain'});
   res.write('Hello, Node.n');
   res.end();
 }).listen(1337);

 console.log('Server running on :1337');




Node’s Anatomy                      CommonJS Require
                                    Server definition
                                    Talk to yourself
Require
 var http = require('http');

 http.createServer(function(req, res) {
   res.writeHead(200,
       {'Content-Type': 'text/plain'});
   res.write('Hello, Node.n');
   res.end();
 }).listen(1337);                 Server
 console.log('Server running on :1337');




Node’s Anatomy                      CommonJS Require
                                    Server definition
                                    Talk to yourself
Require
 var http = require('http');

 http.createServer(function(req, res) {
   res.writeHead(200,
       {'Content-Type': 'text/plain'});
   res.write('Hello, Node.n');
   res.end();
 }).listen(1337);                 Server
 console.log('Server running on :1337');

                        This is for you.

Node’s Anatomy                      CommonJS Require
                                    Server definition
                                    Talk to yourself
Getting Started

                                              • nodejs.org

                                              • API: nodejs.org/api.html

                                              • github.com/ry/node

                                              • github.com/ry/node/wiki

                                              • Google Group [1]

[1]   http://groups.google.com/group/nodejs   • IRC #node.js on Freenode.
Install from source:

 $   git clone http://github.com/ry/node.git
 $   cd node
 $   ./configure
 $   make
 $   make install




Installing Node.js                             It’s really easy.
                                                  (If you’re on a Mac or Linux.)
                                                     Windows... not so much.
Use the Source

http://github.com/ry/node/
Package MGMT
                                    • Use Node Package Manger
                                      aka NPM.

                                    • Community standardized
                                      on NPM in July 2010 [1].

                                    • Install:
                                      github.com/isaacs/npm

                                    • Discover Packages:
[1]   http://dshaw.me/blSO44
                                      npm.mape.me
Use NPM

http://github.com/isaacs/npm/
The Sound of Music   Express
                     Connect
                                   Websocket-Server
                                   Socket-IO
                     Node-Static   Soda
Express

• Express is a *very complete* web
  framework.
• Simple, elegant routing and templating.


• expressjs.com
• github.com/visionmedia/express
• npm install express
Express
// npm dependency
var express = require('express');

var app = express.createServer();

app.get('/', function(req, res){
    res.send('Hello World');
});
app.get('/user/:id', function(req, res){
    res.send('user ' + req.params.id);
});

app.listen(3000);




  • Follow TJ: github.com/visionmedia
Connect

• Connect provides a robust set of
  middleware for building apps:
  logging, static files, JSON-RPC.
• Need sessions, use Connect.


• github.com/senchalabs/connect
• npm install connect
Web Sockets

• Pure Web Sockets.
• Very efficient. Great API.
• Both draft75 and draft76 protocols.
• github.com/miksago/node-websocket-
  server
• npm install websocket-server
Socket.IO

• Abstracts and extends the Web Socket
  metaphor.
• Everything looks like a Web Socket.
• Supports: Flash, XHR Long Polling,
  XHR Multipart Streaming (Comet)
• socket.io (yes, that’s a url.)
• npm install socket.io
Web Sockets Demos
http://github.com/dshaw/canisocket/

           http://dshaw.no.de
http://github.com/dshaw/socketstuffer
Beware: API Changes   A lot of Node.js code you may find on
                      GitHub is outdated. Node tries to help.
More JavaScript   HTML5
                  Canvas
                                  LocalStorage
                                  Web Workers
                  Drag and Drop   Web Sockets
Questions?




http://github.com/dshaw
The new, new hotness.
Eventful JavaScript on the Server

         Thank you.
 http://github.com/dshaw

More Related Content

What's hot

Vagrant - Version control your dev environment
Vagrant - Version control your dev environmentVagrant - Version control your dev environment
Vagrant - Version control your dev environmentbocribbz
 
Create your very own Development Environment with Vagrant and Packer
Create your very own Development Environment with Vagrant and PackerCreate your very own Development Environment with Vagrant and Packer
Create your very own Development Environment with Vagrant and Packerfrastel
 
vert.x 소개 및 개발 실습
vert.x 소개 및 개발 실습vert.x 소개 및 개발 실습
vert.x 소개 및 개발 실습John Kim
 
Configuration Management in the Cloud - Cloud Phoenix Meetup Feb 2014
Configuration Management in the Cloud - Cloud Phoenix Meetup Feb 2014Configuration Management in the Cloud - Cloud Phoenix Meetup Feb 2014
Configuration Management in the Cloud - Cloud Phoenix Meetup Feb 2014Miguel Zuniga
 
Large-scaled Deploy Over 100 Servers in 3 Minutes
Large-scaled Deploy Over 100 Servers in 3 MinutesLarge-scaled Deploy Over 100 Servers in 3 Minutes
Large-scaled Deploy Over 100 Servers in 3 MinutesHiroshi SHIBATA
 
OSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js TutorialOSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js TutorialTom Croucher
 
Intro to Node.js (v1)
Intro to Node.js (v1)Intro to Node.js (v1)
Intro to Node.js (v1)Chris Cowan
 
Getting Started with PureScript
Getting Started with PureScriptGetting Started with PureScript
Getting Started with PureScriptJohn De Goes
 
2 docker engine_hands_on
2 docker engine_hands_on2 docker engine_hands_on
2 docker engine_hands_onFEG
 
OSS Security the hard way
OSS Security the hard wayOSS Security the hard way
OSS Security the hard wayHiroshi SHIBATA
 
How to Begin Developing Ruby Core
How to Begin Developing Ruby CoreHow to Begin Developing Ruby Core
How to Begin Developing Ruby CoreHiroshi SHIBATA
 
CoreOS in a Nutshell
CoreOS in a NutshellCoreOS in a Nutshell
CoreOS in a NutshellCoreOS
 
Building with Virtual Development Environments
Building with Virtual Development EnvironmentsBuilding with Virtual Development Environments
Building with Virtual Development EnvironmentsOscar Merida
 
Getting instantly up and running with Docker and Symfony
Getting instantly up and running with Docker and SymfonyGetting instantly up and running with Docker and Symfony
Getting instantly up and running with Docker and SymfonyAndré Rømcke
 
Building with Virtual Development Environments
Building with Virtual Development EnvironmentsBuilding with Virtual Development Environments
Building with Virtual Development EnvironmentsOscar Merida
 
Dockerizing Symfony Applications - Symfony Live Berlin 2014
Dockerizing Symfony Applications - Symfony Live Berlin 2014Dockerizing Symfony Applications - Symfony Live Berlin 2014
Dockerizing Symfony Applications - Symfony Live Berlin 2014D
 
[Js hcm] Deploying node.js with Forever.js and nginx
[Js hcm] Deploying node.js with Forever.js and nginx[Js hcm] Deploying node.js with Forever.js and nginx
[Js hcm] Deploying node.js with Forever.js and nginxNicolas Embleton
 
Dockerize Me: Distributed PHP applications with Symfony, Docker, Consul and A...
Dockerize Me: Distributed PHP applications with Symfony, Docker, Consul and A...Dockerize Me: Distributed PHP applications with Symfony, Docker, Consul and A...
Dockerize Me: Distributed PHP applications with Symfony, Docker, Consul and A...Alexey Petrov
 
The Future of library dependency manageement of Ruby
The Future of library dependency manageement of RubyThe Future of library dependency manageement of Ruby
The Future of library dependency manageement of RubyHiroshi SHIBATA
 

What's hot (19)

Vagrant - Version control your dev environment
Vagrant - Version control your dev environmentVagrant - Version control your dev environment
Vagrant - Version control your dev environment
 
Create your very own Development Environment with Vagrant and Packer
Create your very own Development Environment with Vagrant and PackerCreate your very own Development Environment with Vagrant and Packer
Create your very own Development Environment with Vagrant and Packer
 
vert.x 소개 및 개발 실습
vert.x 소개 및 개발 실습vert.x 소개 및 개발 실습
vert.x 소개 및 개발 실습
 
Configuration Management in the Cloud - Cloud Phoenix Meetup Feb 2014
Configuration Management in the Cloud - Cloud Phoenix Meetup Feb 2014Configuration Management in the Cloud - Cloud Phoenix Meetup Feb 2014
Configuration Management in the Cloud - Cloud Phoenix Meetup Feb 2014
 
Large-scaled Deploy Over 100 Servers in 3 Minutes
Large-scaled Deploy Over 100 Servers in 3 MinutesLarge-scaled Deploy Over 100 Servers in 3 Minutes
Large-scaled Deploy Over 100 Servers in 3 Minutes
 
OSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js TutorialOSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js Tutorial
 
Intro to Node.js (v1)
Intro to Node.js (v1)Intro to Node.js (v1)
Intro to Node.js (v1)
 
Getting Started with PureScript
Getting Started with PureScriptGetting Started with PureScript
Getting Started with PureScript
 
2 docker engine_hands_on
2 docker engine_hands_on2 docker engine_hands_on
2 docker engine_hands_on
 
OSS Security the hard way
OSS Security the hard wayOSS Security the hard way
OSS Security the hard way
 
How to Begin Developing Ruby Core
How to Begin Developing Ruby CoreHow to Begin Developing Ruby Core
How to Begin Developing Ruby Core
 
CoreOS in a Nutshell
CoreOS in a NutshellCoreOS in a Nutshell
CoreOS in a Nutshell
 
Building with Virtual Development Environments
Building with Virtual Development EnvironmentsBuilding with Virtual Development Environments
Building with Virtual Development Environments
 
Getting instantly up and running with Docker and Symfony
Getting instantly up and running with Docker and SymfonyGetting instantly up and running with Docker and Symfony
Getting instantly up and running with Docker and Symfony
 
Building with Virtual Development Environments
Building with Virtual Development EnvironmentsBuilding with Virtual Development Environments
Building with Virtual Development Environments
 
Dockerizing Symfony Applications - Symfony Live Berlin 2014
Dockerizing Symfony Applications - Symfony Live Berlin 2014Dockerizing Symfony Applications - Symfony Live Berlin 2014
Dockerizing Symfony Applications - Symfony Live Berlin 2014
 
[Js hcm] Deploying node.js with Forever.js and nginx
[Js hcm] Deploying node.js with Forever.js and nginx[Js hcm] Deploying node.js with Forever.js and nginx
[Js hcm] Deploying node.js with Forever.js and nginx
 
Dockerize Me: Distributed PHP applications with Symfony, Docker, Consul and A...
Dockerize Me: Distributed PHP applications with Symfony, Docker, Consul and A...Dockerize Me: Distributed PHP applications with Symfony, Docker, Consul and A...
Dockerize Me: Distributed PHP applications with Symfony, Docker, Consul and A...
 
The Future of library dependency manageement of Ruby
The Future of library dependency manageement of RubyThe Future of library dependency manageement of Ruby
The Future of library dependency manageement of Ruby
 

Viewers also liked

Improving DevOps through better monitoring
Improving DevOps through better monitoringImproving DevOps through better monitoring
Improving DevOps through better monitoringLeon Fayer
 
Five Steps to DevOps Success - Avoiding the High Cost of Downtime
Five Steps to DevOps Success - Avoiding the High Cost of DowntimeFive Steps to DevOps Success - Avoiding the High Cost of Downtime
Five Steps to DevOps Success - Avoiding the High Cost of DowntimeAnand Akela
 
Containerization is more than the new Virtualization: enabling separation of ...
Containerization is more than the new Virtualization: enabling separation of ...Containerization is more than the new Virtualization: enabling separation of ...
Containerization is more than the new Virtualization: enabling separation of ...Jérôme Petazzoni
 
Single Sign-On for APEX applications based on Kerberos (Important: latest ver...
Single Sign-On for APEX applications based on Kerberos (Important: latest ver...Single Sign-On for APEX applications based on Kerberos (Important: latest ver...
Single Sign-On for APEX applications based on Kerberos (Important: latest ver...Niels de Bruijn
 
Micro Manchester Meetup: "The Seven (More) Deadly Sins of Microservices"
Micro Manchester Meetup: "The Seven (More) Deadly Sins of Microservices"Micro Manchester Meetup: "The Seven (More) Deadly Sins of Microservices"
Micro Manchester Meetup: "The Seven (More) Deadly Sins of Microservices"Daniel Bryant
 
"The State of Macro Redux" - Bruegel
"The State of Macro Redux" - Bruegel"The State of Macro Redux" - Bruegel
"The State of Macro Redux" - BruegelMacropru Reader
 
Use of standards and related issues in predictive analytics
Use of standards and related issues in predictive analyticsUse of standards and related issues in predictive analytics
Use of standards and related issues in predictive analyticsPaco Nathan
 
The Brain Science Of Buying
The Brain Science Of BuyingThe Brain Science Of Buying
The Brain Science Of BuyingSusan Weinschenk
 
Application Centric Approach to Devops
Application Centric Approach to DevopsApplication Centric Approach to Devops
Application Centric Approach to DevopsNati Shalom
 
Keynote at CloudExpo and DevOps Summit 2014, Silicon Valley
Keynote at CloudExpo and DevOps Summit 2014, Silicon ValleyKeynote at CloudExpo and DevOps Summit 2014, Silicon Valley
Keynote at CloudExpo and DevOps Summit 2014, Silicon ValleyVictoria Livschitz
 
Product Owner Innovation Toolkit Meetup #2 Innovation Games
Product Owner Innovation Toolkit Meetup #2 Innovation GamesProduct Owner Innovation Toolkit Meetup #2 Innovation Games
Product Owner Innovation Toolkit Meetup #2 Innovation GamesHeiko Bartlog
 
صندوق أدوات البحث العلمي
صندوق أدوات البحث العلميصندوق أدوات البحث العلمي
صندوق أدوات البحث العلميHend Al-Khalifa
 
Formalizing the informal: Experiences from a training and certification schem...
Formalizing the informal: Experiences from a training and certification schem...Formalizing the informal: Experiences from a training and certification schem...
Formalizing the informal: Experiences from a training and certification schem...ILRI
 
د. إسراء الطريقي صندوق أدوات البحث العلمي
د. إسراء الطريقي  صندوق أدوات البحث العلميد. إسراء الطريقي  صندوق أدوات البحث العلمي
د. إسراء الطريقي صندوق أدوات البحث العلميresearchcenterm
 
Doing Business in the UK, Northern Ireland and the Republic of Ireland
Doing Business in the UK, Northern Ireland and the Republic of IrelandDoing Business in the UK, Northern Ireland and the Republic of Ireland
Doing Business in the UK, Northern Ireland and the Republic of IrelandRadius - Global Growth Experts
 
الاستئناف بداية نهاية الشلل التاريخي - أبو يعرب المرزوقي
الاستئناف   بداية نهاية الشلل التاريخي - أبو يعرب المرزوقيالاستئناف   بداية نهاية الشلل التاريخي - أبو يعرب المرزوقي
الاستئناف بداية نهاية الشلل التاريخي - أبو يعرب المرزوقيأبو يعرب المرزوقي
 
Mensagem da Presidenta Dilma ao Senado e ao Povo Brasileiro
Mensagem da Presidenta Dilma ao Senado e ao Povo BrasileiroMensagem da Presidenta Dilma ao Senado e ao Povo Brasileiro
Mensagem da Presidenta Dilma ao Senado e ao Povo BrasileiroDilmaRousseff
 
برامج مساعدة في البحث العلمي
برامج مساعدة في البحث العلميبرامج مساعدة في البحث العلمي
برامج مساعدة في البحث العلميMoneer Abed
 

Viewers also liked (20)

Improving DevOps through better monitoring
Improving DevOps through better monitoringImproving DevOps through better monitoring
Improving DevOps through better monitoring
 
Five Steps to DevOps Success - Avoiding the High Cost of Downtime
Five Steps to DevOps Success - Avoiding the High Cost of DowntimeFive Steps to DevOps Success - Avoiding the High Cost of Downtime
Five Steps to DevOps Success - Avoiding the High Cost of Downtime
 
Containerization is more than the new Virtualization: enabling separation of ...
Containerization is more than the new Virtualization: enabling separation of ...Containerization is more than the new Virtualization: enabling separation of ...
Containerization is more than the new Virtualization: enabling separation of ...
 
Single Sign-On for APEX applications based on Kerberos (Important: latest ver...
Single Sign-On for APEX applications based on Kerberos (Important: latest ver...Single Sign-On for APEX applications based on Kerberos (Important: latest ver...
Single Sign-On for APEX applications based on Kerberos (Important: latest ver...
 
Micro Manchester Meetup: "The Seven (More) Deadly Sins of Microservices"
Micro Manchester Meetup: "The Seven (More) Deadly Sins of Microservices"Micro Manchester Meetup: "The Seven (More) Deadly Sins of Microservices"
Micro Manchester Meetup: "The Seven (More) Deadly Sins of Microservices"
 
"The State of Macro Redux" - Bruegel
"The State of Macro Redux" - Bruegel"The State of Macro Redux" - Bruegel
"The State of Macro Redux" - Bruegel
 
Use of standards and related issues in predictive analytics
Use of standards and related issues in predictive analyticsUse of standards and related issues in predictive analytics
Use of standards and related issues in predictive analytics
 
The Brain Science Of Buying
The Brain Science Of BuyingThe Brain Science Of Buying
The Brain Science Of Buying
 
Application Centric Approach to Devops
Application Centric Approach to DevopsApplication Centric Approach to Devops
Application Centric Approach to Devops
 
Keynote at CloudExpo and DevOps Summit 2014, Silicon Valley
Keynote at CloudExpo and DevOps Summit 2014, Silicon ValleyKeynote at CloudExpo and DevOps Summit 2014, Silicon Valley
Keynote at CloudExpo and DevOps Summit 2014, Silicon Valley
 
Product Owner Innovation Toolkit Meetup #2 Innovation Games
Product Owner Innovation Toolkit Meetup #2 Innovation GamesProduct Owner Innovation Toolkit Meetup #2 Innovation Games
Product Owner Innovation Toolkit Meetup #2 Innovation Games
 
صندوق أدوات البحث العلمي
صندوق أدوات البحث العلميصندوق أدوات البحث العلمي
صندوق أدوات البحث العلمي
 
Formalizing the informal: Experiences from a training and certification schem...
Formalizing the informal: Experiences from a training and certification schem...Formalizing the informal: Experiences from a training and certification schem...
Formalizing the informal: Experiences from a training and certification schem...
 
Enei
EneiEnei
Enei
 
د. إسراء الطريقي صندوق أدوات البحث العلمي
د. إسراء الطريقي  صندوق أدوات البحث العلميد. إسراء الطريقي  صندوق أدوات البحث العلمي
د. إسراء الطريقي صندوق أدوات البحث العلمي
 
Doing Business in the UK, Northern Ireland and the Republic of Ireland
Doing Business in the UK, Northern Ireland and the Republic of IrelandDoing Business in the UK, Northern Ireland and the Republic of Ireland
Doing Business in the UK, Northern Ireland and the Republic of Ireland
 
الاستئناف بداية نهاية الشلل التاريخي - أبو يعرب المرزوقي
الاستئناف   بداية نهاية الشلل التاريخي - أبو يعرب المرزوقيالاستئناف   بداية نهاية الشلل التاريخي - أبو يعرب المرزوقي
الاستئناف بداية نهاية الشلل التاريخي - أبو يعرب المرزوقي
 
Mensagem da Presidenta Dilma ao Senado e ao Povo Brasileiro
Mensagem da Presidenta Dilma ao Senado e ao Povo BrasileiroMensagem da Presidenta Dilma ao Senado e ao Povo Brasileiro
Mensagem da Presidenta Dilma ao Senado e ao Povo Brasileiro
 
Maakuntauudistus, Tampere 17.8.2016 Tuomas Pöystin esitys
Maakuntauudistus, Tampere 17.8.2016 Tuomas Pöystin esitysMaakuntauudistus, Tampere 17.8.2016 Tuomas Pöystin esitys
Maakuntauudistus, Tampere 17.8.2016 Tuomas Pöystin esitys
 
برامج مساعدة في البحث العلمي
برامج مساعدة في البحث العلميبرامج مساعدة في البحث العلمي
برامج مساعدة في البحث العلمي
 

Similar to Node.js - The New, New Hotness

Introduction to NodeJS with LOLCats
Introduction to NodeJS with LOLCatsIntroduction to NodeJS with LOLCats
Introduction to NodeJS with LOLCatsDerek Anderson
 
Practical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.jsPractical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.jsasync_io
 
Nodejs a-practical-introduction-oredev
Nodejs a-practical-introduction-oredevNodejs a-practical-introduction-oredev
Nodejs a-practical-introduction-oredevFelix Geisendörfer
 
GeekCampSG - Nodejs , Websockets and Realtime Web
GeekCampSG - Nodejs , Websockets and Realtime WebGeekCampSG - Nodejs , Websockets and Realtime Web
GeekCampSG - Nodejs , Websockets and Realtime WebBhagaban Behera
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.jsorkaplan
 
Introduction to Node.js: What, why and how?
Introduction to Node.js: What, why and how?Introduction to Node.js: What, why and how?
Introduction to Node.js: What, why and how?Christian Joudrey
 
node.js: Javascript's in your backend
node.js: Javascript's in your backendnode.js: Javascript's in your backend
node.js: Javascript's in your backendDavid Padbury
 
Node js quick-tour_v2
Node js quick-tour_v2Node js quick-tour_v2
Node js quick-tour_v2http403
 
Node js quick-tour_v2
Node js quick-tour_v2Node js quick-tour_v2
Node js quick-tour_v2tianyi5212222
 
Построение простого REST сервера на Node.js | Odessa Frontend Code challenge
Построение простого REST сервера на Node.js | Odessa Frontend Code challengeПостроение простого REST сервера на Node.js | Odessa Frontend Code challenge
Построение простого REST сервера на Node.js | Odessa Frontend Code challengeOdessaFrontend
 
Server-Side JavaScript Developement - Node.JS Quick Tour
Server-Side JavaScript Developement - Node.JS Quick TourServer-Side JavaScript Developement - Node.JS Quick Tour
Server-Side JavaScript Developement - Node.JS Quick Tourq3boy
 
Introduction to node.js GDD
Introduction to node.js GDDIntroduction to node.js GDD
Introduction to node.js GDDSudar Muthu
 
Node.js - A practical introduction (v2)
Node.js  - A practical introduction (v2)Node.js  - A practical introduction (v2)
Node.js - A practical introduction (v2)Felix Geisendörfer
 
The future of server side JavaScript
The future of server side JavaScriptThe future of server side JavaScript
The future of server side JavaScriptOleg Podsechin
 
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: The What, The How and The When
Node.js: The What, The How and The WhenNode.js: The What, The How and The When
Node.js: The What, The How and The WhenFITC
 
Writing robust Node.js applications
Writing robust Node.js applicationsWriting robust Node.js applications
Writing robust Node.js applicationsTom Croucher
 
Dcjq node.js presentation
Dcjq node.js presentationDcjq node.js presentation
Dcjq node.js presentationasync_io
 

Similar to Node.js - The New, New Hotness (20)

Introduction to NodeJS with LOLCats
Introduction to NodeJS with LOLCatsIntroduction to NodeJS with LOLCats
Introduction to NodeJS with LOLCats
 
Practical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.jsPractical Use of MongoDB for Node.js
Practical Use of MongoDB for Node.js
 
Nodejs a-practical-introduction-oredev
Nodejs a-practical-introduction-oredevNodejs a-practical-introduction-oredev
Nodejs a-practical-introduction-oredev
 
GeekCampSG - Nodejs , Websockets and Realtime Web
GeekCampSG - Nodejs , Websockets and Realtime WebGeekCampSG - Nodejs , Websockets and Realtime Web
GeekCampSG - Nodejs , Websockets and Realtime Web
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.js
 
Introduction to Node.js: What, why and how?
Introduction to Node.js: What, why and how?Introduction to Node.js: What, why and how?
Introduction to Node.js: What, why and how?
 
node.js: Javascript's in your backend
node.js: Javascript's in your backendnode.js: Javascript's in your backend
node.js: Javascript's in your backend
 
Node js quick-tour_v2
Node js quick-tour_v2Node js quick-tour_v2
Node js quick-tour_v2
 
Node js quick-tour_v2
Node js quick-tour_v2Node js quick-tour_v2
Node js quick-tour_v2
 
Построение простого REST сервера на Node.js | Odessa Frontend Code challenge
Построение простого REST сервера на Node.js | Odessa Frontend Code challengeПостроение простого REST сервера на Node.js | Odessa Frontend Code challenge
Построение простого REST сервера на Node.js | Odessa Frontend Code challenge
 
Server-Side JavaScript Developement - Node.JS Quick Tour
Server-Side JavaScript Developement - Node.JS Quick TourServer-Side JavaScript Developement - Node.JS Quick Tour
Server-Side JavaScript Developement - Node.JS Quick Tour
 
Introduction to node.js GDD
Introduction to node.js GDDIntroduction to node.js GDD
Introduction to node.js GDD
 
Node.js - A practical introduction (v2)
Node.js  - A practical introduction (v2)Node.js  - A practical introduction (v2)
Node.js - A practical introduction (v2)
 
The future of server side JavaScript
The future of server side JavaScriptThe future of server side JavaScript
The future of server side JavaScript
 
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: The What, The How and The When
Node.js: The What, The How and The WhenNode.js: The What, The How and The When
Node.js: The What, The How and The When
 
Writing robust Node.js applications
Writing robust Node.js applicationsWriting robust Node.js applications
Writing robust Node.js applications
 
node.js - Fast event based web application development
node.js - Fast event based web application developmentnode.js - Fast event based web application development
node.js - Fast event based web application development
 
Nodejs - A quick tour (v6)
Nodejs - A quick tour (v6)Nodejs - A quick tour (v6)
Nodejs - A quick tour (v6)
 
Dcjq node.js presentation
Dcjq node.js presentationDcjq node.js presentation
Dcjq node.js presentation
 

Node.js - The New, New Hotness

  • 1. The new, new hotness. Eventful JavaScript on the Server @dshaw
  • 2. About.me/dshaw Web Application Developer WVU 2006, 2008 WVU ACM Treasurer
  • 3. What’s your avor? Java Python C / C++ / C# Erlang / Haskell Ruby JavaScript
  • 4. JavaScript, really? • Learning Javascript used to mean you weren't a "serious software developer". Today, not learning Javascript means the same thing. - James Governor ( @monkchips ) • http://twitter.com/monkchips/status/25217409319
  • 5. The Hype Hacker News <3’s Node.js “Everyone’s talking about it.”
  • 6. GitHub Node is the #3 most watched project on GitHub ...and moving fast.
  • 7. Why is Node.js so hot?
  • 8. Node’s Fast. Non-blocking event driven architecture.
  • 9. Your Fast! Speed from idea to prototype to production.
  • 10. Developer Satisfaction! Love your code. Love coding.
  • 11. My Favorite Reason • JavaScript on the Client • JavaScript on the Server = Fun!
  • 12. Show Me Some Code! var http = require('http'); http.createServer(function(req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.write('Hello, Node.n'); res.end(); }).listen(1337); console.log('Server running on :1337');
  • 14. var http = require('http'); http.createServer(function(req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.write('Hello, Node.n'); res.end(); }).listen(1337); console.log('Server running on :1337'); Essential Node.js You probably won’t spend too much time writing request/response code.
  • 15. var http = require('http'); http.createServer(function(req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.write('Hello, Node.n'); res.end(); }).listen(1337); console.log('Server running on :1337'); Essential Node.js Don’t cheat yourself. You need to spend some time though.
  • 16. Require var http = require('http'); http.createServer(function(req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.write('Hello, Node.n'); res.end(); }).listen(1337); console.log('Server running on :1337'); Node’s Anatomy CommonJS Require Server definition Talk to yourself
  • 17. Require var http = require('http'); http.createServer(function(req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.write('Hello, Node.n'); res.end(); }).listen(1337); Server console.log('Server running on :1337'); Node’s Anatomy CommonJS Require Server definition Talk to yourself
  • 18. Require var http = require('http'); http.createServer(function(req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.write('Hello, Node.n'); res.end(); }).listen(1337); Server console.log('Server running on :1337'); This is for you. Node’s Anatomy CommonJS Require Server definition Talk to yourself
  • 19. Getting Started • nodejs.org • API: nodejs.org/api.html • github.com/ry/node • github.com/ry/node/wiki • Google Group [1] [1] http://groups.google.com/group/nodejs • IRC #node.js on Freenode.
  • 20. Install from source: $ git clone http://github.com/ry/node.git $ cd node $ ./configure $ make $ make install Installing Node.js It’s really easy. (If you’re on a Mac or Linux.) Windows... not so much.
  • 22. Package MGMT • Use Node Package Manger aka NPM. • Community standardized on NPM in July 2010 [1]. • Install: github.com/isaacs/npm • Discover Packages: [1] http://dshaw.me/blSO44 npm.mape.me
  • 24. The Sound of Music Express Connect Websocket-Server Socket-IO Node-Static Soda
  • 25. Express • Express is a *very complete* web framework. • Simple, elegant routing and templating. • expressjs.com • github.com/visionmedia/express • npm install express
  • 26. Express // npm dependency var express = require('express'); var app = express.createServer(); app.get('/', function(req, res){ res.send('Hello World'); }); app.get('/user/:id', function(req, res){ res.send('user ' + req.params.id); }); app.listen(3000); • Follow TJ: github.com/visionmedia
  • 27. Connect • Connect provides a robust set of middleware for building apps: logging, static files, JSON-RPC. • Need sessions, use Connect. • github.com/senchalabs/connect • npm install connect
  • 28. Web Sockets • Pure Web Sockets. • Very efficient. Great API. • Both draft75 and draft76 protocols. • github.com/miksago/node-websocket- server • npm install websocket-server
  • 29. Socket.IO • Abstracts and extends the Web Socket metaphor. • Everything looks like a Web Socket. • Supports: Flash, XHR Long Polling, XHR Multipart Streaming (Comet) • socket.io (yes, that’s a url.) • npm install socket.io
  • 30. Web Sockets Demos http://github.com/dshaw/canisocket/ http://dshaw.no.de http://github.com/dshaw/socketstuffer
  • 31. Beware: API Changes A lot of Node.js code you may find on GitHub is outdated. Node tries to help.
  • 32. More JavaScript HTML5 Canvas LocalStorage Web Workers Drag and Drop Web Sockets
  • 34. The new, new hotness. Eventful JavaScript on the Server Thank you. http://github.com/dshaw

Editor's Notes