Site Meter
 
 

Node.js development with WebMatrix 2 and Express

I’m sure by now everyone has heard plenty about Node.js, the lightweight JavaScript-on-the-server web platform. But maybe you’ve been putting off trying it out because it’s unclear what exactly to download and install on Windows to get the best development experience.

Delay no longer! Get WebMatrix 2 (Release Candidate) and it will take care of installing all the bits you need (Node, Node Package Manager, and IISNode), and will give you a first-rate IDE experience including fancy features like autocompletion that understands Node packages and conventions.

Tutorial videos

So then, what can you do with Node and WebMatrix? This is the first in a three-part series of videos about building a mobile web app with Node.js, Express, and WebMatrix:

  1. (This post) Getting started with Node and Express using WebMatrix 2 — 12 minutes
  2. Building a web app with static UI / dynamic API architecture — 20 minutes
  3. Hints and tricks for optimising for mobiles — 14 minutes

The material is based on a talk I gave at DevSum in Stockholm a month or two back.

OK, here it is! Be sure to watch it full-screen in 720p quality, by the way, for the most readable code…

24 Responses to Node.js development with WebMatrix 2 and Express

  1. Khalid Abuhakmeh

    There’s something about the way you talk Steve that makes me want to do whatever it is you are talking about. Really comforting and engaging.

    Just don’t start a cult…

    Great Video as Always!

  2. Mark Adamson

    I’m guessing the spectrum keyboard is a joke :) I had one of those from an auction for £5 but we never got it to work.

  3. Francisco Oliveira

    That was a TK-90X? Many thanks for this video. I can’t wait for the next video.

  4. Andreas Fluegge

    Realy cool stuff! Can’t wait to see the next part! Steve, you are a incredible good presenter!

  5. kris

    Hello Steve,

    Very happy to hear from you. I have using node.js from webmatrix beta through the template you have gave and follow you through galloway’s post.

    When I tried node on windows it’s work fine. no problem but when most of modules not worked it’s going useless. I have told many author that their plugin not worked on windows. some of them response that they have not made it.

    suppose Node-xmpp-bosh or mangodb part of everyauth authentication. Do you any idea to solve this issue.

  6. Steve

    Khalid – Hmm, now you’re giving me ideas… :)

    Francisco – No, it’s a ZX Spectrum. We have pretty limited budget for hardware upgrades, so we have to make do with these 8-bit machines. On the positive side, my workstation is lighter than a MacBook Air, never runs out of battery power, and has a whopping 48Kb of RAM, so I can’t really complain.

    Kris – I guess it may take a little longer before Windows support becomes near-universal for NPM modules, but we did some compatibility investigations and found the considerable majority of the most depended-on ones work fine already. The most important one that lacked Windows support was the Redis client, but I think that may have been solved now. The Mongo module definitely works fine. Perhaps you could contribute to the everyauth module by fixing their Mongo support on Windows if it’s currently broken :)

  7. Steve, thanks for this series. It was really well done and highly inspirational!

    I would only ask that you increase your microphone gain in the future so I can hear you more easily! :)

  8. paul

    great set of videos, finally the motivation i need to check out node in more detail. BTW, can I ask what is the iOS simulator product that you are using?

    regards

  9. paul

    in fact, just ran full screen and realised you were using vmware…doh!

  10. Edmund Herbert

    Hello Steve, a quick question regarding Node and Webmatrix2, is there support to access the SQLCE database from Node.

    Regards

    Edmund Herbert

  11. Pingback: Microsoft WebMatrix ze wsparciem dla jQuery Mobile i nie tylko. « Mobile Web

  12. paul

    man thi sis awesome

  13. Wow – that was a superslick way of get up and running with Node.js on the Windows platform.

    I redid the whole thing after watching this and it literally took me 5 minutes, including installing Web Matrix

    I’m officially impressed.

  14. Pete

    Thanks Steve this was very usefule BTW I download your code and tried to run it in WebMatrix but get the following error HTTP Error 500.19 – Internal Server Error
    The requested page cannot be accessed because the related configuration data for the page is invalid. Any ideas

  15. Pingback: Node.js development with WebMatrix 2 and Express – Steve Sanderson’s blog – As seen on YouTube™ « CupScript

  16. Pingback: Bases de datos con Razor y WebMatrix | Dave Rndn Blog

  17. Ray

    FYI for all folks, after upgrading node.js to 3.0 from 2.5, you should create app not from ‘app = express.createServer()’, but ‘app = express()’ !!

  18. Cam

    Besides changing the line pointed out by Ray for the new syntax ‘app = express()’ the only other problem I’ve run across is that the logging doesn’t work, or at least not the way it does in the video. I do not have a folder called server.js.logs… there is no additional folder created at all.

    I’m wondering of that’s something else that changed with version changes.

  19. We have been paying a coder we found from ‘freelancer’ to undertake a project to design an app where our customers could take a picture of some glasses they might have seen on the high street. The software would recognize the shape of the frame and colour and it would search our database to see if anything closely matched at a better price. The coder told us that he was using node.js to enable him to complete the project.

  20. Pavan Sibal

    Great Tutorial !!!

  21. Dave

    @Cam the logging didn’t work for me the way it was in the video either.

    What happened was that an iisnode folder was created and log files were put in there.

    However, you couldn’t open these in the browser. If you tried you got the (custom) 404 page.

  22. John Dutcher

    I did a starter template site…made no changes to the basic vanilla site created. Won’t run though…throws 0x80070000d msg…bad web.config file? I see the port shown in URL was 4337…but the server.js file shows listening on 3000 ??? I see nothing wrong with web.config….is there not some xml editor supposed to be with Web Matrix that would examine web.config ?

  23. John Dutcher

    I don’t see why all your video displays of the web pages show 9137 as the port when the server.js file shows 8080 ?

  24. John Dutcher

    Ok, I will stop…noticing that the only ‘site’ that will run is the ‘Empty’ site choice. I note that has no server.js file…but using port 8080 it at least runs and serves a page.