38
@dmytromindra #msswi WEB В РЕАЛЬНОМ ВРЕМЕНИ С WINDOWS AZURE И NODE.JS Дмитрий Миндра, Lohika http://www.slideshare.net/dmytromindra

Web В РЕАЛЬНОМ ВРЕМЕНИ С Windows Azure И Node.js

  • Upload
    caron

  • View
    80

  • Download
    3

Embed Size (px)

DESCRIPTION

http://www.slideshare.net/dmytromindra. Дмитрий Миндра, Lohika. Web В РЕАЛЬНОМ ВРЕМЕНИ С Windows Azure И Node.js. Вы замечательные !. Для кого этот доклад?. Вам нравится JavaScript Вы хотите чего-то нового! Вам нравится Web. Мустафин Дмитрий. RnD Team Lead - PowerPoint PPT Presentation

Citation preview

PowerPoint Presentation

Web Windows Azure Node.js , Lohikahttp://www.slideshare.net/dmytromindra@dmytromindra #msswit !

@dmytromindra #msswit ? JavaScript

- !

Web

@dmytromindra #msswit RnD Team Lead

Microsoft Technologies Lab Member

@dmytromindra #msswit

@dmytromindra #msswit5

, PHP! Java! Perl, . , Ruby Python!

(c) xakephttp://www.xakep.ru/post/53583/@dmytromindra #msswit6

!@dmytromindra #msswit, , , , . (Photo and caption by Lisa Roberts)

http://www.liveinternet.ru/users/3662045/post126599968/7

@dmytromindra #msswit Node.JS ? .

http://www.openews.net/2012/node-js-all-php-developers-should-know-500/8

Node.js&23 2011@dmytromindra #msswitvar http = require('http');

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

console.log('Server running at http://127.0.0.1:1337/');HELLO WORLD@dmytromindra #msswit NODE.JS? Node.JS - .Event Driven Google V8 Microsoft ( /)@dmytromindra #msswit , , Node.JS .

@dmytromindra #msswit Node.JS , .

( Cluster)

@dmytromindra #msswit var fs = require('fs') , path = require('path') , file1 = "file1.txt , file2 = "file2.txt";

// Check if file1 exists, write to file2, // then display new file2 contents. path.exists(file1, function (exists) { if (!exists) throw new Error("No file!"); fs.readFile(file1, function (err, data) { if (err) throw err; fs.writeFile(file2, data, function (err) { if (err) throw err; fs.readFile(file2, function (err, data) { if (err) throw err; console.log(data.toString()); ... }); }); }); });

@dmytromindra #msswit .

.

@dmytromindra #msswit ? Node!Web SPAWindows AzureSocket.IO

@dmytromindra #msswit

@dmytromindra #msswit~ 10 17Node Package Manager ,

npm install azure

npm install g express

@dmytromindra #msswitWEB @dmytromindra #msswit ?JavaScript . , . .Express()Jade()Mustache( , )Sammy.js()jQuery()@dmytromindra #msswit WEB Express, Jade .

@dmytromindra #msswitSPA* -, .

. .

*http://en.wikipedia.org/wiki/Single_Page_Application

@dmytromindra #msswitWindows Azure

@dmytromindra #msswit : Windows Azure Node.js Windows PowerShell Node , Windows Azure compute emulator Windows Azure

:https://www.windowsazure.com/en-us/develop/nodejs/tutorials/getting-started/https://www.windowsazure.com/en-us/develop/nodejs/tutorials/web-app-with-storage/

@dmytromindra #msswit , npm install azure

c:\node\tasklist\WebRole1\Web.cloud.config Azure.

:C:\node\tasklist\WebRole1\node_modules\azure\README.md

JavaScript :var azure = require('azure');

! !@dmytromindra #msswit : var tableService = azure.createTableService();

: var myTableName = MyTable;

:tableService.createTableIfNotExists(myTableName, OnCreatedFunc);

OnCreatedFunc , (Callback)function OnCreatedFunc(errorObject, createdBoolFlag) {}

:http://www.windowsazure.com/en-us/develop/nodejs/how-to-guides/table-services/

@dmytromindra #msswit Azure . PK Partition Row .

: var myObj = { PartitionKey: MyPartition, RowKey: myRowKey, myProp1: Dima+", myProp2: Luba=, myProp3: Misha};

:tableService.insertEntity( myTableName, myObj, OnMyObjInserted);

OnMyObjInserted callback-function OnMyObjInserted(error, serverEntity) {}

@dmytromindra #msswit :var myObjUpd = { PartitionKey: MyPartition, RowKey: myRowKey", myProp1: Dima+", myProp2: Luba=, myProp3: Misha and Margo" };

: tableService.updateEntity( myTableName, myObjUpd, OnMyObjUpdated); OnMyObjUpdated , , callback:function OnMyObjUpdated(error, serverEntity) {}

: , ServerEntity !

@dmytromindra #msswit :tableService.queryEntity(myTableName, myPartition, myRowKey, OnEntityQueried);

callback:function OnEntityQueried(error, serverEntity) {}

:var query = azure.TableQuery.select().from(myTableName).where(PartitionKey eq ?, MyPartition);tableService.queryEntities(query, OnEntitiesQueried);

allback:function OnEntitiesQueried(error, serverEntities) {}@dmytromindra #msswit BLOB? , :var azure = require('azure');var blobService = azure.createBlobService();blobService.createContainerIfNotExists();blobService.createBlockBlobFromStream();blobService.listBlobs();blobService.getBlobToStream();blobService.deleteBlob();

http://www.windowsazure.com/en-us/develop/nodejs/how-to-guides/blob-storage/

@dmytromindra #msswitSocket.IOWEB @dmytromindra #msswitWebSockets . HTML5 Real-Time .

@dmytromindra #msswit SOCKET.IO?, WebSockets. . . :WebSocketFlash SocketAJAX long-pollingAJAX multipart streamingIFrameJSONP polling@dmytromindra #msswit , . .

@dmytromindra #msswit @dmytromindra #msswitJavaScript . .

JavaScript . .

. :@dmytromindra #msswit ?http://nodeguide.com/convincing_the_boss.html

http://stackoverflow.com/questions/5495984/coding-style-guide-for-node-js-apps

Node?http://stackoverflow.com/questions/1884724/what-is-node-js@dmytromindra #msswit ! !

[email protected]@dmytromindra #msswit38