SlideShare uma empresa Scribd logo
1 de 39
EXPRESS
                             web framework for node




Aaron Heckmann
aaronheckmann@gmail.com                                     Area 15
http://twitter.com/aaronheckmann                      April 15 2010
HISTORY
 (abridged)
GMAIL
CHROME
V8
RYAN DAHL
SERVERS
NGINX
EVENT LOOP
JAVASCRIPT
SPEED
V8
evented I/O for V8 javascript
ASYNC I/O
<?php
// I block!
$data = file_get_contents($file)
// do stuff with $data
?>
ASYNC I/O
<?php
// I block!
$data = file_get_contents($file)
// do stuff with $data
?>



jQuery.ajax({
   success: function(data) {
     // do something with data
   }
})
ASYNC I/O
<?php
// I block!
$data = file_get_contents($file)
// do stuff with $data
?>



jQuery.ajax({
   success: function(data) {
     // do something with data
   }
})



// I don’t block!
var fs = require('fs')
fs.readFile(file, function(err, data) {
   // i can has data
})
REQUIRE
• Node     uses the commonJS module system

• returns    the exported API of a module

// math.js
exports.add = function() {
   var sum = arguments[0];
   for (var i=1; i<arguments.length; i++) {
     sum += arguments[i];
   }
   return sum;
};

// app.js
var add = require('math').add;
add(4, 8, 15, 16, 23, 42); //-> 108
FAMILIAR

• addListener()

• removeListener()

• setTimeout()

• setInterval()
LOW LEVEL

• HTTP     / TCP / DNS

• file   system

• child   processes

• event   emitters

• and   streams, oh my!
• lots

• lots

• more
EXPRESS

• simple   install

• built   on node

• async   rendering

• plugable
SIMPLE INSTALL

$ git clone git://github.com/visionmedia/express.git
$ cd express && git submodule update --init


                               or
$ kiwi -v install express
BUILT ON NODE
// app.js

require.paths.unshift('path/to/express/lib')
require('express')

get('/', function(){
   this.redirect('/hello/world')
})

get('/hello/world', function(){
   return 'Hello World'
})

run()




$ node app.js
Express started at http://localhost:8000/ in development mode
ASYNC RENDERING


get('/', function(){
   return '<!doctype html><html><head><title>...'
})
ASYNC RENDERING


get('/', function() {
   var self = this // => Request
})
ASYNC RENDERING

get('/', function() {
   var self = this
   db.get(someUserId, function(err, user) {
      if (err) return self.error(err);
   })
})
ASYNC RENDERING
get('/', function() {
   var self = this
   db.get(someUserId, function(err, user) {
      if (err) return self.error(err);
      self.render('home.html.haml', {
         layout: 'layout-public’,
         locals: {
           title: 'intro to express',
           firstname: user.firstname
         }
      })
   })
})
#wrap
  .welcome
    %p= “Hello ” + firstname + “!”




<div id=“wrap”>
  <div class=“welcome”>
    <p>Hello Aaron!</p>
  </div>
</div>
.welcome
  :margin 5px
  p
    :color #2C7C00
    :text-shadow 1px 2px 1px #ddd




.welcome {
  margin: 5px; }
.welcome p {
  color: #2C7C00;
  text-shadow: 1px 2px 1px #ddd; }
PLUGABLE
PLUGABLE

• View, Cache, Redirect, etc   (defaults)

• Cookie, Session, Flash, Logger, Static, etc   (optional)

• 3rd   party session persistence (MongoDB, Redis)

• Async!
PLUGABLE

var Logger = require('express/plugins/logger').Logger
use(Logger, {format: 'combined'})
MOAR

• partials   & flash messaging

• custom     error pages (500, 404)

• http   (async curl)

• uploads

• custom     environment configurations

• ES5    (v8)
THANK YOU
•   http://expressjs.com/

•   http://groups.google.com/group/express-js

•   http://github.com/visionmedia/express

•   http://nodejs.org/

•   http://groups.google.com/group/nodejs

•   http://wiki.github.com/ry/node/modules

•   http://twitter.com/expressjs

•   http://twitter.com/aaronheckmann

Mais conteúdo relacionado

Mais procurados

Perl web frameworks
Perl web frameworksPerl web frameworks
Perl web frameworksdiego_k
 
Persistent mobile JavaScript
Persistent mobile JavaScriptPersistent mobile JavaScript
Persistent mobile JavaScriptYorick Phoenix
 
The hitchhiker's guide to the Webpack - Sara Vieira - Codemotion Amsterdam 2017
The hitchhiker's guide to the Webpack - Sara Vieira - Codemotion Amsterdam 2017The hitchhiker's guide to the Webpack - Sara Vieira - Codemotion Amsterdam 2017
The hitchhiker's guide to the Webpack - Sara Vieira - Codemotion Amsterdam 2017Codemotion
 
WorkFlow: An Inquiry Into Productivity by Timothy Bolton
WorkFlow:  An Inquiry Into Productivity by Timothy BoltonWorkFlow:  An Inquiry Into Productivity by Timothy Bolton
WorkFlow: An Inquiry Into Productivity by Timothy BoltonMiva
 
Webrtc mojo
Webrtc mojoWebrtc mojo
Webrtc mojobpmedley
 
Creating Reusable Puppet Profiles
Creating Reusable Puppet ProfilesCreating Reusable Puppet Profiles
Creating Reusable Puppet ProfilesBram Vogelaar
 
Integrating icinga2 and the HashiCorp suite
Integrating icinga2 and the HashiCorp suiteIntegrating icinga2 and the HashiCorp suite
Integrating icinga2 and the HashiCorp suiteBram Vogelaar
 
Lessons Learnt in 2009
Lessons Learnt in 2009Lessons Learnt in 2009
Lessons Learnt in 2009pratiknaik
 
Web Apps in Perl - HTTP 101
Web Apps in Perl - HTTP 101Web Apps in Perl - HTTP 101
Web Apps in Perl - HTTP 101hendrikvb
 
Asynchronous programming patterns in Perl
Asynchronous programming patterns in PerlAsynchronous programming patterns in Perl
Asynchronous programming patterns in Perldeepfountainconsulting
 
The Peanut Butter Cup of Web-dev: Plack and single page web apps
The Peanut Butter Cup of Web-dev: Plack and single page web appsThe Peanut Butter Cup of Web-dev: Plack and single page web apps
The Peanut Butter Cup of Web-dev: Plack and single page web appsJohn Anderson
 
Infrastructure as code terraformujeme cloud
Infrastructure as code   terraformujeme cloudInfrastructure as code   terraformujeme cloud
Infrastructure as code terraformujeme cloudViliamPucik
 
Observability with Consul Connect
Observability with Consul ConnectObservability with Consul Connect
Observability with Consul ConnectBram Vogelaar
 
The promise of asynchronous php
The promise of asynchronous phpThe promise of asynchronous php
The promise of asynchronous phpWim Godden
 
Build web application by express
Build web application by expressBuild web application by express
Build web application by expressShawn Meng
 
Node.js Express
Node.js  ExpressNode.js  Express
Node.js ExpressEyal Vardi
 

Mais procurados (20)

RESTful web services
RESTful web servicesRESTful web services
RESTful web services
 
Perl web frameworks
Perl web frameworksPerl web frameworks
Perl web frameworks
 
Persistent mobile JavaScript
Persistent mobile JavaScriptPersistent mobile JavaScript
Persistent mobile JavaScript
 
The hitchhiker's guide to the Webpack - Sara Vieira - Codemotion Amsterdam 2017
The hitchhiker's guide to the Webpack - Sara Vieira - Codemotion Amsterdam 2017The hitchhiker's guide to the Webpack - Sara Vieira - Codemotion Amsterdam 2017
The hitchhiker's guide to the Webpack - Sara Vieira - Codemotion Amsterdam 2017
 
WorkFlow: An Inquiry Into Productivity by Timothy Bolton
WorkFlow:  An Inquiry Into Productivity by Timothy BoltonWorkFlow:  An Inquiry Into Productivity by Timothy Bolton
WorkFlow: An Inquiry Into Productivity by Timothy Bolton
 
Webrtc mojo
Webrtc mojoWebrtc mojo
Webrtc mojo
 
Creating Reusable Puppet Profiles
Creating Reusable Puppet ProfilesCreating Reusable Puppet Profiles
Creating Reusable Puppet Profiles
 
Integrating icinga2 and the HashiCorp suite
Integrating icinga2 and the HashiCorp suiteIntegrating icinga2 and the HashiCorp suite
Integrating icinga2 and the HashiCorp suite
 
Lessons Learnt in 2009
Lessons Learnt in 2009Lessons Learnt in 2009
Lessons Learnt in 2009
 
Web Apps in Perl - HTTP 101
Web Apps in Perl - HTTP 101Web Apps in Perl - HTTP 101
Web Apps in Perl - HTTP 101
 
Asynchronous programming patterns in Perl
Asynchronous programming patterns in PerlAsynchronous programming patterns in Perl
Asynchronous programming patterns in Perl
 
The Peanut Butter Cup of Web-dev: Plack and single page web apps
The Peanut Butter Cup of Web-dev: Plack and single page web appsThe Peanut Butter Cup of Web-dev: Plack and single page web apps
The Peanut Butter Cup of Web-dev: Plack and single page web apps
 
Infrastructure as code terraformujeme cloud
Infrastructure as code   terraformujeme cloudInfrastructure as code   terraformujeme cloud
Infrastructure as code terraformujeme cloud
 
Observability with Consul Connect
Observability with Consul ConnectObservability with Consul Connect
Observability with Consul Connect
 
The promise of asynchronous php
The promise of asynchronous phpThe promise of asynchronous php
The promise of asynchronous php
 
Jk rubyslava 25
Jk rubyslava 25Jk rubyslava 25
Jk rubyslava 25
 
World of Logging
World of LoggingWorld of Logging
World of Logging
 
G* on GAE/J 挑戦編
G* on GAE/J 挑戦編G* on GAE/J 挑戦編
G* on GAE/J 挑戦編
 
Build web application by express
Build web application by expressBuild web application by express
Build web application by express
 
Node.js Express
Node.js  ExpressNode.js  Express
Node.js Express
 

Destaque

Passport Nodejs Lightening Talk
Passport Nodejs Lightening TalkPassport Nodejs Lightening Talk
Passport Nodejs Lightening TalkKianosh Pourian
 
Erick Belluci Tedeschi - Segurança em WordPress
Erick Belluci Tedeschi - Segurança em WordPressErick Belluci Tedeschi - Segurança em WordPress
Erick Belluci Tedeschi - Segurança em WordPressiMasters
 
Node.js with express
Node.js with expressNode.js with express
Node.js with expressjavakidxxx
 
Introduction to node.js GDD
Introduction to node.js GDDIntroduction to node.js GDD
Introduction to node.js GDDSudar Muthu
 
Building your first Node app with Connect & Express
Building your first Node app with Connect & ExpressBuilding your first Node app with Connect & Express
Building your first Node app with Connect & ExpressChristian Joudrey
 
Why Node, Express and Postgres - presented 23 Feb 15, Talkjs, Microsoft Audit...
Why Node, Express and Postgres - presented 23 Feb 15, Talkjs, Microsoft Audit...Why Node, Express and Postgres - presented 23 Feb 15, Talkjs, Microsoft Audit...
Why Node, Express and Postgres - presented 23 Feb 15, Talkjs, Microsoft Audit...Calvin Tan
 
Introduction to REST API with Node.js
Introduction to REST API with Node.jsIntroduction to REST API with Node.js
Introduction to REST API with Node.jsYoann Gotthilf
 
Node Architecture and Getting Started with Express
Node Architecture and Getting Started with ExpressNode Architecture and Getting Started with Express
Node Architecture and Getting Started with Expressjguerrero999
 
TDD a REST API With Node.js and MongoDB
TDD a REST API With Node.js and MongoDBTDD a REST API With Node.js and MongoDB
TDD a REST API With Node.js and MongoDBValeri Karpov
 
Node JS Express: Steps to Create Restful Web App
Node JS Express: Steps to Create Restful Web AppNode JS Express: Steps to Create Restful Web App
Node JS Express: Steps to Create Restful Web AppEdureka!
 
Shootout! Template engines for the JVM
Shootout! Template engines for the JVMShootout! Template engines for the JVM
Shootout! Template engines for the JVMJeroen Reijn
 
Complete MVC on NodeJS
Complete MVC on NodeJSComplete MVC on NodeJS
Complete MVC on NodeJSHüseyin BABAL
 
Node JS Express : Steps to Create Restful Web App
Node JS Express : Steps to Create Restful Web AppNode JS Express : Steps to Create Restful Web App
Node JS Express : Steps to Create Restful Web AppEdureka!
 
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
 

Destaque (20)

Passport Nodejs Lightening Talk
Passport Nodejs Lightening TalkPassport Nodejs Lightening Talk
Passport Nodejs Lightening Talk
 
Node.js with Express
Node.js with ExpressNode.js with Express
Node.js with Express
 
WP REST API
WP REST APIWP REST API
WP REST API
 
Erick Belluci Tedeschi - Segurança em WordPress
Erick Belluci Tedeschi - Segurança em WordPressErick Belluci Tedeschi - Segurança em WordPress
Erick Belluci Tedeschi - Segurança em WordPress
 
Node.js with express
Node.js with expressNode.js with express
Node.js with express
 
Introduction to node.js GDD
Introduction to node.js GDDIntroduction to node.js GDD
Introduction to node.js GDD
 
Sails js
Sails jsSails js
Sails js
 
Building your first Node app with Connect & Express
Building your first Node app with Connect & ExpressBuilding your first Node app with Connect & Express
Building your first Node app with Connect & Express
 
Why Node, Express and Postgres - presented 23 Feb 15, Talkjs, Microsoft Audit...
Why Node, Express and Postgres - presented 23 Feb 15, Talkjs, Microsoft Audit...Why Node, Express and Postgres - presented 23 Feb 15, Talkjs, Microsoft Audit...
Why Node, Express and Postgres - presented 23 Feb 15, Talkjs, Microsoft Audit...
 
Introduction to REST API with Node.js
Introduction to REST API with Node.jsIntroduction to REST API with Node.js
Introduction to REST API with Node.js
 
Node Architecture and Getting Started with Express
Node Architecture and Getting Started with ExpressNode Architecture and Getting Started with Express
Node Architecture and Getting Started with Express
 
TDD a REST API With Node.js and MongoDB
TDD a REST API With Node.js and MongoDBTDD a REST API With Node.js and MongoDB
TDD a REST API With Node.js and MongoDB
 
Node JS Express: Steps to Create Restful Web App
Node JS Express: Steps to Create Restful Web AppNode JS Express: Steps to Create Restful Web App
Node JS Express: Steps to Create Restful Web App
 
Rest api with node js and express
Rest api with node js and expressRest api with node js and express
Rest api with node js and express
 
Shootout! Template engines for the JVM
Shootout! Template engines for the JVMShootout! Template engines for the JVM
Shootout! Template engines for the JVM
 
Node js
Node jsNode js
Node js
 
Complete MVC on NodeJS
Complete MVC on NodeJSComplete MVC on NodeJS
Complete MVC on NodeJS
 
Node JS Express : Steps to Create Restful Web App
Node JS Express : Steps to Create Restful Web AppNode JS Express : Steps to Create Restful Web App
Node JS Express : Steps to Create Restful Web App
 
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.
 

Semelhante a Express Presentation

[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVCAlive Kuo
 
Writing robust Node.js applications
Writing robust Node.js applicationsWriting robust Node.js applications
Writing robust Node.js applicationsTom Croucher
 
JavaScript performance patterns
JavaScript performance patternsJavaScript performance patterns
JavaScript performance patternsStoyan Stefanov
 
HTML5: huh, what is it good for?
HTML5: huh, what is it good for?HTML5: huh, what is it good for?
HTML5: huh, what is it good for?Remy Sharp
 
Velocity EU 2014 — Offline-first web apps
Velocity EU 2014 — Offline-first web appsVelocity EU 2014 — Offline-first web apps
Velocity EU 2014 — Offline-first web appsandrewsmatt
 
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryTatsuhiko Miyagawa
 
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)Igor Bronovskyy
 
Using and scaling Rack and Rack-based middleware
Using and scaling Rack and Rack-based middlewareUsing and scaling Rack and Rack-based middleware
Using and scaling Rack and Rack-based middlewareAlona Mekhovova
 
Future of Web Apps: Google Gears
Future of Web Apps: Google GearsFuture of Web Apps: Google Gears
Future of Web Apps: Google Gearsdion
 
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)Doris Chen
 
Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...
Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...
Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...BradNeuberg
 
Great Developers Steal
Great Developers StealGreat Developers Steal
Great Developers StealBen Scofield
 
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディングXitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディングscalaconfjp
 
Xitrum @ Scala Matsuri Tokyo 2014
Xitrum @ Scala Matsuri Tokyo 2014Xitrum @ Scala Matsuri Tokyo 2014
Xitrum @ Scala Matsuri Tokyo 2014Ngoc Dao
 
How and why i roll my own node.js framework
How and why i roll my own node.js frameworkHow and why i roll my own node.js framework
How and why i roll my own node.js frameworkBen Lin
 
Asynchronous Interfaces
Asynchronous InterfacesAsynchronous Interfaces
Asynchronous Interfacesmaccman
 
Primefaces Nextgen Lju
Primefaces Nextgen LjuPrimefaces Nextgen Lju
Primefaces Nextgen LjuSkills Matter
 

Semelhante a Express Presentation (20)

Frontend Servers and NGINX: What, Where and How
Frontend Servers and NGINX: What, Where and HowFrontend Servers and NGINX: What, Where and How
Frontend Servers and NGINX: What, Where and How
 
[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC
 
Writing robust Node.js applications
Writing robust Node.js applicationsWriting robust Node.js applications
Writing robust Node.js applications
 
JavaScript performance patterns
JavaScript performance patternsJavaScript performance patterns
JavaScript performance patterns
 
HTML5: huh, what is it good for?
HTML5: huh, what is it good for?HTML5: huh, what is it good for?
HTML5: huh, what is it good for?
 
Velocity EU 2014 — Offline-first web apps
Velocity EU 2014 — Offline-first web appsVelocity EU 2014 — Offline-first web apps
Velocity EU 2014 — Offline-first web apps
 
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
 
Play vs Rails
Play vs RailsPlay vs Rails
Play vs Rails
 
Web-Performance
Web-PerformanceWeb-Performance
Web-Performance
 
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
 
Using and scaling Rack and Rack-based middleware
Using and scaling Rack and Rack-based middlewareUsing and scaling Rack and Rack-based middleware
Using and scaling Rack and Rack-based middleware
 
Future of Web Apps: Google Gears
Future of Web Apps: Google GearsFuture of Web Apps: Google Gears
Future of Web Apps: Google Gears
 
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
 
Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...
Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...
Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...
 
Great Developers Steal
Great Developers StealGreat Developers Steal
Great Developers Steal
 
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディングXitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
 
Xitrum @ Scala Matsuri Tokyo 2014
Xitrum @ Scala Matsuri Tokyo 2014Xitrum @ Scala Matsuri Tokyo 2014
Xitrum @ Scala Matsuri Tokyo 2014
 
How and why i roll my own node.js framework
How and why i roll my own node.js frameworkHow and why i roll my own node.js framework
How and why i roll my own node.js framework
 
Asynchronous Interfaces
Asynchronous InterfacesAsynchronous Interfaces
Asynchronous Interfaces
 
Primefaces Nextgen Lju
Primefaces Nextgen LjuPrimefaces Nextgen Lju
Primefaces Nextgen Lju
 

Último

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 

Último (20)

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 

Express Presentation

  • 1. EXPRESS web framework for node Aaron Heckmann aaronheckmann@gmail.com Area 15 http://twitter.com/aaronheckmann April 15 2010
  • 3.
  • 6. V8
  • 12. SPEED
  • 13. V8
  • 14. evented I/O for V8 javascript
  • 15. ASYNC I/O <?php // I block! $data = file_get_contents($file) // do stuff with $data ?>
  • 16. ASYNC I/O <?php // I block! $data = file_get_contents($file) // do stuff with $data ?> jQuery.ajax({ success: function(data) { // do something with data } })
  • 17. ASYNC I/O <?php // I block! $data = file_get_contents($file) // do stuff with $data ?> jQuery.ajax({ success: function(data) { // do something with data } }) // I don’t block! var fs = require('fs') fs.readFile(file, function(err, data) { // i can has data })
  • 18.
  • 19. REQUIRE • Node uses the commonJS module system • returns the exported API of a module // math.js exports.add = function() { var sum = arguments[0]; for (var i=1; i<arguments.length; i++) { sum += arguments[i]; } return sum; }; // app.js var add = require('math').add; add(4, 8, 15, 16, 23, 42); //-> 108
  • 20. FAMILIAR • addListener() • removeListener() • setTimeout() • setInterval()
  • 21. LOW LEVEL • HTTP / TCP / DNS • file system • child processes • event emitters • and streams, oh my!
  • 23.
  • 24. EXPRESS • simple install • built on node • async rendering • plugable
  • 25. SIMPLE INSTALL $ git clone git://github.com/visionmedia/express.git $ cd express && git submodule update --init or $ kiwi -v install express
  • 26. BUILT ON NODE // app.js require.paths.unshift('path/to/express/lib') require('express') get('/', function(){ this.redirect('/hello/world') }) get('/hello/world', function(){ return 'Hello World' }) run() $ node app.js Express started at http://localhost:8000/ in development mode
  • 27. ASYNC RENDERING get('/', function(){ return '<!doctype html><html><head><title>...' })
  • 28. ASYNC RENDERING get('/', function() { var self = this // => Request })
  • 29. ASYNC RENDERING get('/', function() { var self = this db.get(someUserId, function(err, user) { if (err) return self.error(err); }) })
  • 30. ASYNC RENDERING get('/', function() { var self = this db.get(someUserId, function(err, user) { if (err) return self.error(err); self.render('home.html.haml', { layout: 'layout-public’, locals: { title: 'intro to express', firstname: user.firstname } }) }) })
  • 31.
  • 32. #wrap .welcome %p= “Hello ” + firstname + “!” <div id=“wrap”> <div class=“welcome”> <p>Hello Aaron!</p> </div> </div>
  • 33.
  • 34. .welcome :margin 5px p :color #2C7C00 :text-shadow 1px 2px 1px #ddd .welcome { margin: 5px; } .welcome p { color: #2C7C00; text-shadow: 1px 2px 1px #ddd; }
  • 36. PLUGABLE • View, Cache, Redirect, etc (defaults) • Cookie, Session, Flash, Logger, Static, etc (optional) • 3rd party session persistence (MongoDB, Redis) • Async!
  • 37. PLUGABLE var Logger = require('express/plugins/logger').Logger use(Logger, {format: 'combined'})
  • 38. MOAR • partials & flash messaging • custom error pages (500, 404) • http (async curl) • uploads • custom environment configurations • ES5 (v8)
  • 39. THANK YOU • http://expressjs.com/ • http://groups.google.com/group/express-js • http://github.com/visionmedia/express • http://nodejs.org/ • http://groups.google.com/group/nodejs • http://wiki.github.com/ry/node/modules • http://twitter.com/expressjs • http://twitter.com/aaronheckmann

Notas do Editor