You can do that very easily using:
Connects is like Rack in Ruby. It gives you an extra layer where you can "play" with authentication, sessions, cookies, among others.
Other option is to use frameworks:
It seems to be the most used node.js framework. Is like Sinatra for Ruby and runs on top of connect.
If you want to do more complex WebApps, Geddy is the one you choose. Is like Rails for Ruby.