Node.js has taken off in popularity. Find out why major internet companies like Yammer, CouchOne, DocumentCloud, and LinkedIn are using Node to power their servers. And why Microsoft added support for it to Azure. In this session we will build a simple yet functional web server using Node, enhance it using plugins known as Modules, and hopefully explain why Node is such a powerful new web server paradigm.
2. Who am I?
I am a Microsoft Certified Solution Developer and I’ve
been developing software since 1979. Since 2009, I have
been focused on developing mobile applications, for
iPhone, Android, the mobile web, and Windows Phone 7.
3. What We’re Not Going
to Cover
• The Depth of Windows Azure
• Visual Studio
• Windows 8
• Git
4. What We Will Cover
• Node and npm
• Windows Azure Website
• How to Deploy
5. Windows Azure is an open cloud platform that enables
you to quickly build, deploy and manage applications
across a global network of Microsoft-managed
datacenters.
You can build applications using any language, tool or
framework.
6. • Microsoft’s Cloud Computing Platform
• Version 1.0 Introduced February 2010
• Last Major Release on June 7, 2012
7. Node.js is a platform built on Chrome's JavaScript
runtime for easily building fast, scalable network
applications. Node.js uses an event-driven, non-blocking
I/O model that makes it lightweight and efficient, perfect
for data-intensive real-time applications that run across
distributed devices.
8. • aka. Node
• Introduced in 2009 By Ryan Dahl of Joyent
• Current Version 0.6.19
• Version 0.7.12 is in preview
• Selected by InfoWorld for the
“Technology of the Year Award
9. Why Node?
• It’s Fast
• Minimalistic
• Avoids Context Switching
• Single Threaded
10. How To Node on Azure
• Node as a Cloud Service
• Node as a Web Site
• Node as a Web Site with WebMatrix
11. Create a Windows
Azure Account
• windowsazure.com
• click the free trial button (90 days free)
• You will need a windows live ID
14. Hello Node!
var http = require('http'); // what is http?
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello Node!n');
}).listen(3000, '127.0.0.1');
console.log('Server running at http://127.0.0.1:3000/');
15. Packages
• Core
Modules which are compiled into Node
• Userland
Everything else
16. Core Modules
• http - HTTP server and client
• url - utilities for URL resolution and parsing
• path - utilities for handling and transforming
file paths
• fs - File I/O is provided by simple wrappers
around standard POSIX functions
20. Userland Modules
• connect
• express - high performance, high class web
development for Node.js
built on top of connect
• mongodb - port of mongodb to non-blocking
JavaScript
• plus many, many more
21. If there is something
you need to do in
Node, first look for a
module to do it for
you.