develop & deploy node.js app on windows azure

42
Node.js App on Windows Azure BDV TechThursday, Jun 26, 2014 [email protected] | @andri_yadi | http://andriyadi.com

Upload: andri-yadi

Post on 26-Jan-2015

142 views

Category:

Software


0 download

DESCRIPTION

It's the keynote on Telkom Bandung Digital Valley's TechThursday. I talked about developing and deploying Node.js application on Windows Azure. Attented by 20 web developers around Bandung city. To try the code I demoed, here's the repo: https://github.com/andriyadi/NodeAzureStorageSocketIO

TRANSCRIPT

Page 1: Develop & Deploy Node.js app on Windows Azure

Node.js App on Windows Azure

BDV TechThursday, Jun 26, 2014

[email protected] | @andri_yadi | http://andriyadi.com

Page 2: Develop & Deploy Node.js app on Windows Azure

about me

Page 3: Develop & Deploy Node.js app on Windows Azure

CEO of

Page 4: Develop & Deploy Node.js app on Windows Azure

a movie freak

movreak

Page 5: Develop & Deploy Node.js app on Windows Azure

start up companies for 10 years15 years in software development

Page 6: Develop & Deploy Node.js app on Windows Azure

6 years in a row

1 of 2 Azure MVPs in Indonesia, of 114 in the worlds

Page 7: Develop & Deploy Node.js app on Windows Azure

The first & largest iOS & OSX developer community in Indonesia

ID-ObjectiveCPresident

Page 8: Develop & Deploy Node.js app on Windows Azure

Focus on Demo :)

Disclaime

r

Page 9: Develop & Deploy Node.js app on Windows Azure
Page 10: Develop & Deploy Node.js app on Windows Azure

Only 5 years old

But seems everybody use it!

Page 11: Develop & Deploy Node.js app on Windows Azure

Node.js on Raspberry Pi

Page 12: Develop & Deploy Node.js app on Windows Azure

A platform with event-driven, non-blocking IO model,

built on Chrome JavaScript runtime

What???

Page 13: Develop & Deploy Node.js app on Windows Azure

Event-drive Non-blocking Asynchronous

I/O Model

Page 14: Develop & Deploy Node.js app on Windows Azure

De facto language for the web Event-driven Node.js = JavaScript on server

JavaScript

Page 15: Develop & Deploy Node.js app on Windows Azure

Chrome’s JavaScript runtime V8 is really fast It’s (sort of) compiled

V8

Page 16: Develop & Deploy Node.js app on Windows Azure

var http = require('http'); http.Server(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello World\n'); }).listen(3000);

HTTP Server

A simple standalone working HTTP server Web development from the scratch :)

Page 17: Develop & Deploy Node.js app on Windows Azure

Built-in modules Third-party (> 80,000) Build your own :)

Highly modularised

Page 18: Develop & Deploy Node.js app on Windows Azure

Node Package Manager

NPM

Page 19: Develop & Deploy Node.js app on Windows Azure

Install Node.js from pre-built installers, or build from source code

http://nodejs.org/download/

Get started?

Page 20: Develop & Deploy Node.js app on Windows Azure

Enough slides! Show me some code

Your wish is my command

Page 21: Develop & Deploy Node.js app on Windows Azure

Real-world web development should use this module! !

npm install express !

or if you’ve installed express-generator module, just type: express

Express

Page 22: Develop & Deploy Node.js app on Windows Azure

More code please!

Your wish is my command

Page 23: Develop & Deploy Node.js app on Windows Azure

To Do List demo

Page 24: Develop & Deploy Node.js app on Windows Azure

Enables real-time bidirectional event-based communication !

npm install socket.io !

*Socket.IO 1.0 is different than 0.9.x. Make sure to read migration guide.

Socket.io

Page 25: Develop & Deploy Node.js app on Windows Azure

Change prev demo with Socket.IO

Page 26: Develop & Deploy Node.js app on Windows Azure

on “connection” event

“alltasks” event

“addtask” event

broadcast “newtask” event

“completetask” event

broadcast “taskcompleted” event

Socket.IO realtime events

No need to post data via HTTP POST!

Page 27: Develop & Deploy Node.js app on Windows Azure

Node.js on Windows Azure

What???

Page 28: Develop & Deploy Node.js app on Windows Azure
Page 29: Develop & Deploy Node.js app on Windows Azure

Among other thin

gs, Azure provides

:

Page 30: Develop & Deploy Node.js app on Windows Azure

Some of Azure Service...

Page 31: Develop & Deploy Node.js app on Windows Azure

Supported Web Frameworks

Or any custom FastCGI Handler

For you, web developers

Page 32: Develop & Deploy Node.js app on Windows Azure

So, how to deploy Node.js app to Windows Azure?

I use Mac as development machine :)Disclaimer

Page 33: Develop & Deploy Node.js app on Windows Azure

azure-cli is your friend npm install azure-cli -g

Azure-CLI

Page 34: Develop & Deploy Node.js app on Windows Azure

Get Azure account. Buy or free trial :) !

Login to Azure and select subscription (if > 1): !

azure account download azure account import <file> azure account set <subscription>

Deploy Node.js on Azure Website

Page 35: Develop & Deploy Node.js app on Windows Azure

Creating website from current directory: !

azure site create —-git git add . git commit -m "First Commit” git push azure master !

That’s it!

Deploy Node.js on Azure Website

Page 36: Develop & Deploy Node.js app on Windows Azure

More detail articles: • http://azure.microsoft.com/en-us/documentation/

articles/xplat-cli/ • http://azure.microsoft.com/en-us/documentation/

articles/storage-nodejs-use-table-storage-web-site/ !

There’re more options to deploy Node.js to Azure. Just check here: http://azure.microsoft.com/en-us/develop/nodejs/

Deploy Node.js on Azure Website

Page 37: Develop & Deploy Node.js app on Windows Azure

Get your hand on iOS 8 or Node.js?

Let’s join upcoming iOS 8 & Node.js development class!

More info: http://dycode.co.id [email protected]

ADS

Page 38: Develop & Deploy Node.js app on Windows Azure

Discussion

Page 39: Develop & Deploy Node.js app on Windows Azure

Live demo

http://intro2node.azurewebsites.net/

I’ll keep alive as long as possible :)

Page 40: Develop & Deploy Node.js app on Windows Azure

Source code

https://github.com/andriyadi/NodeAzureStorageSocketIO

To run, follow instruction there. Good luck :)

Page 41: Develop & Deploy Node.js app on Windows Azure

a leading mobile & web apps developer, an early adopter, an

award-winning company