         res.type r.type if r.type?
         res.send r.handler
         return
-    else
+    else if r.handler.call?
       app[r.verb] r.path, r.middleware, (req, res, next) ->
         ctx =
           app: app

        res.type(r.type) if r.type?
        if typeof result is 'string' then res.send result
        else return result

  # Register socket.io handlers.
  io?.sockets.on 'connection', (socket) ->

log = console.log
fs = require 'fs'
path = require 'path'
util = require 'util'
uuid = require 'node-uuid'
methods = require 'methods'

