Modified to use Express 3, and changed a few things to get the code working