20.03.2012 Dipl.-Inf. (FH) Johannes Hoppe Getting started with Node.js and MongoDB on MS Azure ®
May 17, 2015
20.03.2012 Dipl.-Inf. (FH) Johannes Hoppe
Getting started with Node.js and MongoDB on MS Azure
®
Hello
01
JavaScript?
As a server side
language?
Executed inside
a database?
For a hardware-
accelerated
3D game?
Hosted on
WINDOWS?
Yes! of course
Live Demo www.solartournament.org
SDK for Node.js
02
PaaS / IaaS
Visual Studio 2010
Targets .NET, but also and now officially:
Java, PHP, Node.js… MongoDB
platform
Cloud
Event-driven Asynchronous I/O
JavaScript Google V8 engine
Server-side MIT License
www.windowsazure.com/en-us/develop/nodejs/
What you get › Node.exe
› IISNode (native IIS module)
› NPM for Windows (package manager)
› […]
Live Demo / Windows PowerShell
› New-AzureService helloworld
› Add-AzureNodeWebRole
› Start-AzureEmulator -launch
server.js var http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello world!'); }).listen(process.env.PORT);
Azure SDK for Node.js
Troubleshooter
Tricky Emulator › Webinstaller: Decide for IIS Express
› Start PowerShell with Admin Rights
Tricky Emulator › Check the Windows Event log
› Last resort: start node.exe manually
Deployment / Windows PowerShell
› Get-AzurePublishSettings
› Import-AzurePublishSettings filename.publishSettings
› Publish-AzureService -name UniqueName -location "North
Europe" -launch
Node.js Web Application Tutorial:
http://www.windowsazure.com/en-
us/develop/nodejs/tutorials/getting-started/
MongoDB
03
“Microsoft has been working with 10gen
to provide MongoDB database
integration for Windows Azure,
including deployment packaging,
documentation, and code samples.” MSDN, December 2011: http://msdn.microsoft.com/en-us/library/gg441573.aspx
http://downloads.mongodb.org/azure/
AzureMongoDeploymentCmdlets.msi
PowerShell › Only once: Get-AzureMongoDBBinaries
› New-AzureService helloMongo
› Add-AzureMongoWorkerRole
› Join-AzureNodeRoleToMongoRole WebRole1
› npm install mongodb
Node.js Web Application
with Storage on MongoDB Tutorial:
https://www.windowsazure.com/en-
us/develop/nodejs/tutorials/web-app-with-mongodb/
TODO!
Questions?
Thank you! Johannes Hoppe
Next Speaking Engagements › 12.04.2012 – .NET UG Niederrhein: AOP / .NET
› 10.05.2012 – .NET UG Karlsruhe: NoSQL / .NET
› 14.05.2012 – .NET Developer Conference (DDC)
Nürnberg: NoSQL / .NET (2 talks)
Picture credits
wave © THesIMPLIFY – Fotolia.com
Stressed businessman © Selecstock – Fotolia.com
Ausgewählter Ordner © Spectral-Design – Fotolia.com
Warnhinweis-Schild © Sascha Tiebel – Fotolia.com
Liste abhaken © Dirk Schumann – Fotolia.com