       @server.listen ZEN.port
       do @handleProcess
       @server
+
+    use: (callback) =>
+      @middleware = @middleware or []
+      @middleware.push callback
 
     handleProcess: ->
       process.on "uncaughtException", (error) =>

                  body = ""
                  response.run "", 413, "text/plain"
                  request.connection.destroy()
              request.on "end", ->
                if body isnt ""
                  if request.headers["content-type"] is CONST.MIME.json
                    parameters[key] = value for key, value of JSON.parse body
                  else
                    parameters[key] = value for key, value of querystring.parse body
                request.parameters = __cast parameters
                endpoint.callback request, response
            else
              form = new formidable.IncomingForm
                multiples     : true
                keepExtensions: true
              form.parse request, (error, parameters, files) ->
                parameters = zenrequest.multipart error, parameters, files
                request.parameters = __cast parameters
                endpoint.callback request, response
          else
            response.page "404", undefined, undefined, 404



    createServer: ->
      @server = __server()
      @server.on "request", (request, response, next) =>

        ZEN.domain = domain.create()
        ZEN.domain.add request
