background preloader

Node.js

Facebook Twitter

Node Tuts - Node.js Free screencast tutorials. Creating a basic site with node.js and Express. A walkthrough on how to create and deploy a basic site with Node.js and the Express framework What we are going to do This walkthrough will go over setting up a basic site using Node.js and Express. The walkthrough is aimed at beginners exploring Node.js as I've had many questions from friends and colleagues about creating and deploying node apps. If you are not a beginner the article probably won't be of much use to you. Here is the site we are going to create. Setup First we need to setup our development environment.

If you are on Linux there are plenty of articles on Google. For Windows users there are also resources on Google but it is a bit more tricky. Prerequisites If everything has installed ok you should now have Node.js and npm running on your machine. Node -v v0.8.21 npm -v 1.2.12 Create an Express site Still with me? First let's install express npm install -g express-generator The -g flag means that you are installing express globally on your system. express -c stylus express_example. Socket.IO: the cross-browser WebSocket for realtime apps. Node.js and Redis Pub-Sub. Static Version This is the 7th in a series of posts leading up to Node.js Knockout on how to use node.js. This post, cross-posted from GitHub, was written by James Bracy, founder of Redis To Go. Redis To Go is a dead simple solution for managed Redis instances.

Node.js and Redis Pub-Sub Node.js is a perfect platform for creating event driven applications. Dependencies Node.js, Redis, and a WebSocket enabled browser (Firefox 4, Google Chrome 4, or Safari 5) are required. The easiest way to get a Redis instance would be to use Redis To Go. . $ git clone cd redis/src$ make$ sudo make install$ cd ../..$ rm -rf redis Now you can start a Redis instance locally using the redis-server command. Create the Project Create a directory for the project. . $ mkdir flight-stream$ cd flight-stream The project will require the Node.js Redis client redis-client, the WebSocket library node-websocket-server, and the MIME library node-mime. Create the Server server.js $ mkdir public. Adam Coffman - Getting your feet wet with node.js and socket.io - Part 1.

I haven’t had a ton of time to work on my node.js project lately so I figured I’d just put it out there in its current form as a learning tool for others. In this blog post I’ll walk you through everything I did to get it working and, by the end, you should be able to write your own basic webapps using socket.io. First, let’s start with an overview of the functionality we’d like to have. We want a semi-real time news feed that can display messages passed in from one or more client applications. In order to tell which application passed in which message, we’d like to have some color coding as well. For this project I’m going to use the Jade templating language, and the Express node.js framework, which provides Sinatra style routing for node applications. Lets start off by creating our app and setting it up to use Jade, socket.io, and Express.

We need to import the Express library and call the createServer() method on it to get a server object. Fzysqr. UPDATE 5 – This tutorial refers to intermediate builds of nodechat, referenced by tags. These will not work quite right due to breaking changes in Socket.io 0.8.X. The latest commit in Github has been updated to be fully functional and I will continue to maintain it as long as there is interest. I do not plan to fix the intermediate tags, so please keep that in mind as you go. UPDATE 4 – The hosted instance of nodechat is no longer.

The last round of changes from socket.io and Google Chrome have broken it and I am not particularly interested in fixing it. UPDATE 3 – There is now a follow up tutorial dealing with user profiles and socket.io authentication: Nodechat.js continued – authentication, profiles, ponies, and a meaner socket.io. UPDATE 2 – Joyent has kindly give me a permanent home for nodechat.js: UPDATE – For the fun of it, here is the demo code hosted on a Joyent no.de smart machine: . Sorry folks. Node.js Intrigued? Backbone.js !!!