WebMatrix and node.js: The easiest way to get started with node on Windows
Tomasz Janczuk and Steve Sanderson are having entirely too much fun. I posted just two weeks ago on Installing and Running node.js applications within IIS on Windows - Are you mad? when Tomasz and the team got node.js running rather nicely under IIS. Now they've got a nice little development environment in WebMatrix.
Cats and Dogs, living together, mass hysteria
Then, Steve and Tomasz decide to share clever thing with us. Well, let me just show you. Remember, this is all in-progress goofing around v0.5 stuff at best but the concepts are sound.
And then:
Hit Run:
How can you use WebMatrix to develop node.js applications yourself? With these easy steps:
- Install WebMatrix
- node.js (x86): http://go.microsoft.com/?linkid=9784334
- iisnode for your Web Server
- Install Steve's node.js templates for WebMatrix
- Open WebMatrix, choose "Site from folder", enter %localappdata%\iisnode\www, start the site, and play with the iisnode samples, or Use Steve's templates to get started quickly
- Profit
Isn't it lovely when LEGO pieces snap together so nicely?
Enjoy, Dear Reader.
About Scott
Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.
About Newsletter
Chcolatey is based on nuget BTW ;-)
you're posts lately have been great
thanks for everything!
I got my existing node.js project running in WebMatrix, but there are a few gotchas I think you should enumerate, in particular with regards to modules and ports.
1. Modules can be downloaded off of github and installed in the node_modules directory of the website. No need for NPM.
2. Socket.io works!
3. Modules have dependencies, which downloading off of github doesn't get you. So don't forget to also download those dependencies. Modules can have their own node_modules subdirectory.
4. WebMatrix sets its own port in IIS Express, so your server/app should reuse that port.
The Express project template was extremely helpful.
I'm a VS-loving Windows dev by day (and sometimes by night) and quite like WebMatrix/WebPages/whatever the hell it's called. But IMHO the easiest way to get node running 'on Windows' is to spin up a Linux VM. npm alone is worth the effort.
i installed everything in the simple list, but it is unable to launch node.
does this setup co-exist well with IIS installed? I know little about IIS Express, so...
1. a debugger. with iisnode the only debugger i've managed to use with node os far (node-inspecrot) is unusable.
2. code completion, of if you like - IntelliSense
without these I fill like developing with emacs in 1995 coding in C and debugging with printfs...
To use this you will only need Web Platform Installer and add a custom feed into it as explained on Helicon Zoo homepage: http://www.helicontech.com/zoo/
After that you navigate to Zoo->Packages->WebMatrix Templates and install. To run application you install Node.js form to Zoo->Packages->Node.js Hosting Package. This package includes Node.js, Helicon Zoo Module for IIS and IIS Express, rippy.py to replace NPM as it does not work on Windows yet and some other useful modules. Helicon Zoo Module (unlike iisnode module mentioned in this article) runs full featured HTTP stack, so you can utilize all asynchronous functions of Node.js, including comet (long polling).
Then to publish (deploy) your web site to a Windows based hosting, this hosting should also install Node.js Hosting Package from Zoo on a remote server. Some other applications, like databases, may be also required.
Any feedback is appreciated. Thank you!
Comments are closed.