     pathname = parse(req.url).pathname
     path = lookupFile pathname, @config
     req.resolvedPath = path
-    res.setHeader 'X-Powered-By', 'Slate'
     @emit 'request', req, res
   
   loadDefaults: ->

    for file in incl
      absolute = join middleDir, file
      if require.resolve absolute
        @use basename(file, extname(file)), require(absolute), null
  
module.exports = HttpServer

class HttpServer extends EventEmitter
  constructor: (@config) ->
    @loadDefaults()
    @on 'request', (req, res) =>
      stack = config.get 'middle'
      next = =>
        ware = stack.shift()
        return unless ware?
        return next() unless ware.fn
        ware.fn req, res, next, @config
      return next()
  
  engine: (ext, obj, data, options) -> @config.engines[ext] = compile: obj, data: data, options: options
  enable: (args...) -> @config.middle.push @config.defaultMiddle[name] for name in args when @config.defaultMiddle[name]?
  use: (name, fn, args...) -> @config.middle.push name: name, fn: fn, args: args
  
  listen: (@port, @host) ->
    if @config.get 'https'
