Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Domains in node 0.8
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Felix Geisendörfer
June 29, 2012
Technology
5.6k
8
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Domains in node 0.8
A quick presentation I gave at HolidayExtras on using the new domain feature in node.js 0.8.
Felix Geisendörfer
June 29, 2012
More Decks by Felix Geisendörfer
See All by Felix Geisendörfer
tus.io - Resumable File Uploads (Lightning Talk)
felixge
2
860
Programming flying robots with JavaScript
felixge
2
1k
Programming flying robots with JavaScript
felixge
0
670
Programming an AR Drone Firmware with JS (de)
felixge
1
680
Faster than C?
felixge
1
1.3k
Flying robots over a 10.000 mile distance with JavaScript.
felixge
0
570
Faster than C?
felixge
1
720
The power of node.js (with quadcopters)
felixge
0
560
Faster than C?
felixge
0
500
Other Decks in Technology
See All in Technology
「Docker Desktop不要の時代」は 来たのか?
ueponx
0
570
不可逆な意思決定を避けながら10億超の顧客データを AI Ready にするデータ基盤設計
baseballyama
1
310
味覇で作るパスタが美味い - 20261001_yabaubuki.dev
livesense
PRO
0
130
LocalStack を使ったサーバーレスアプリケーション開発 / Serverless Development with LocalStack
kakakakakku
1
410
全PRの83%が AIレビューだけでマージできるようになった開発組織は その後どうなったか @2026/10
athug
0
140
DWH の限界突破! AI エージェント向け爆速リアルタイムデータ基盤 ClickHouse
jozono
1
390
DevelopersIO 2026 知識の地図を描く ─ オントロジーとは何か?
ishikawa_satoru
1
1.5k
USB PDを使ってスマホを労わりたい
raspython3
0
160
遠藤な_めぐろLT #38 「社内のAI活用推進」@麻布台_20261009
endonanana
0
110
hackers_champloo_2026_tidb
makocchi
0
140
メルペイ 会計システム概要と歴史
mewuto
1
210
⾮構造化データを価値に変える AI エージェント基盤とその組織
ivry_presentationmaterials
0
140
Featured
See All Featured
Rebuilding a faster, lazier Slack
samanthasiow
85
9.7k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
320
The agentic SEO stack - context over prompts
schlessera
0
970
brightonSEO & MeasureFest 2025 - Winning Strategies for Black Friday CRO & PPC - Christian Goodrich
cargoodrich
3
870
Tell your own story through comics
letsgokoyo
1
1.1k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
800
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
1k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.6k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
700
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.8k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Transcript
Domains in node 0.8 A quick introduction Freitag, 29. Juni
12
1 var app = require('express')(); 2 3 app.get('/search', function(req, res,
next) { 4 doSearch(req.params, function(err, result) { 5 if (err) return next(err); 6 7 // trying to access non-existing property 8 if (result.foo.bar) { 9 console.log('does not work'); 10 } 11 }); 12 }); 13 14 app.listen(8080); Freitag, 29. Juni 12
/Users/Felix/Desktop/domains/example.js:14 if (result.foo.bar) { ^ TypeError: Cannot read property 'bar'
of undefined at /Users/Felix/Desktop/domains/example.js:14:19 at doSearch (/Users/Felix/Desktop/domains/example.js:3:5) at process.startup.processNextTick.process._tickCallback (node.js:244:9) Freitag, 29. Juni 12
1 process.on('uncaughtException', function(err) { 2 // Keeps the process from
crashing 3 // But does not let you find out which `req` 4 // was causing the `err` 5 }); Freitag, 29. Juni 12
Domains to the rescue! Freitag, 29. Juni 12
1 var createDomain = require('domain').create; 2 3 app.use(function(req, res, next)
{ 4 var domain = createDomain(); 5 6 domain.on('error', function(err) { 7 // alternative: next(err) 8 res.statusCode = 500; 9 res.end(err.message + '\n'); 10 11 domain.dispose(); 12 }); 13 14 domain.enter(); 15 next(); 16 }); Freitag, 29. Juni 12
$ curl -i localhost:8080/search HTTP/1.1 500 Internal Server Error X-Powered-By:
Express Date: Fri, 29 Jun 2012 10:50:18 GMT Connection: keep-alive Transfer-Encoding: chunked Cannot read property 'bar' of undefined Freitag, 29. Juni 12
Questions? Freitag, 29. Juni 12
Hiring node.js developers @ marcgreenstock @dan_jenkins Freitag, 29. Juni 12