   # Register a route with express.
   route = (r) ->
     r.middleware ?= []
-
-    # Rewrite middleware
-    r.middleware = r.middleware.map wrap_middleware
 
     if typeof r.handler is 'string'
       app[r.verb] r.path, r.middleware, (req, res) ->

    app.disable i for i in arguments
    return

  wrap_middleware = (f) ->
    (req,res,next) ->
      ctx =
        app: app

      if zappa_middleware[name]
        app.use zappa_middleware[name](arg)
      else if typeof express[name] is 'function'
        app.use express[name](arg)
      else
        throw "Unknown middleware #{name}"

    for a in arguments
      switch typeof a
        when 'function' then app.use a
        when 'string' then use a
        when 'object'
          if a.stack? or a.route? or a.handle?
