Tip of the Day: Calculating durations with Moment

Moment has quite a nice fluent interface for some operations, others just need a little more thought. For example, I wanted the duration of something and I had recorded the start and end time. I thought something like this, finding the difference between two dates and converting it to a duration, would work: var duration […]

DunDDD 2014: Introduction to Node.js–From Hello World to Deploying on Azure

Thank you for those that came to my talk. As promised here are the slides, code, and links given in the talk. Slides and Code The slide deck is available as a PDF file. Hello World (zip – 4.82kb) File Dependencies (zip – 6.91kb) Node Package Manager (zip – 22.86mb) Express Hello World (zip – […]

Deploying a Node.js with Express application on Azure

By the end of the last post, there was enough of an application to deploy it, so let’s deploy it. Prerequisites An FTP client to get at the files on Azure. A GitHub account (or other source control, but this walk through uses GitHub) to deploy to Azure. And an Azure account – this walk […]

Node.js with Express – Come to the dark side. We have cookies!

So far, so good. At the point the application displays a list of languages and will display the language that the user picked. However, for the flashcards to work, that selection will have to be remembered. As there is so little state, it is possible to store that in a cookie. Express handles the creation […]

Node.js with Express – Getting form data

Now that view engines are wired up and working on this application, the next area to look at is getting data back from the browser. By default Express doesn’t do anything with form data in the request and a piece of “middleware” needs to be added to get this to work. The reason for this […]

Express for node.js – View Engines

In the last post, Express Hello World, I talked about getting started with an Express application in Node.js. In it, the output was rendered by writing HTML directly. In most situations that is undesirable and some sort of view or template engine is better suited to rendering the output. This post follows on directly from […]

Express for node.js walk through – Hello World

While both Visual Studio and WebStorm have templates for node.js Express applications in this post (and and subsequent few posts) I’m going to walk through setting up an Express application so that you can see how it fits together. Installing Express To start with I created a folder with just a package.json file in it, […]

Node Package Manager – npm

The Node Package Manager is a bit like NuGet for node. It is a way to get additional functionality into node for frameworks that were not bundled with node itself. Like NuGet it has its own website where you can browse the available packages. It is at https://www.npmjs.org/  Installing a package To installing a package, […]

Node.js – Setting up a basic development environment

Node.js is a platform for executing JavaScript outside of the browser. It runs on the Google V8 engine which effectively means it is cross platform as it can run on Windows, Mac OS X, and Linux. Since JavaScript written for Node.js is running on one platform issues that plague browser based JavaScript does not occur […]