         if @matchUrl req
           @destroy req, res
 
-  constructor: (opts) ->
-    @url = opts.url
-
   create: (req, res) ->
     notFound res
 

    if res.headersSent
      return

server = http
  .createServer app
  .listen 80

  destroy: (req, res) ->
    notFound res

ap = new Ctrl url: '/ap'
ap.findOne = (req, res) ->
  wifi.getAPDetails (cfg) ->
    res.writeHead 200, ap.headers
    res.end JSON.stringify cfg

sta = new Ctrl url: '/sta'
sta.findOne = (req, res) ->
  wifi.getDetails (cfg) ->
    res.writeHead 200, sta.headers
    res.end JSON.stringify cfg

ctrls = [ap, sta]

app = (req, res) ->
  writeHead = res.writeHead
  res.writeHead = (statusCode, headers) ->
    writeHead.call res, statusCode, headers
    res.headersSent = true

  write = res.write
  res.write = (data) ->
    write.call res, data
    res.headersSent = true

  end = res.end
  res.end = (data) ->
    end.call res, data
    res.headersSent = true

  for ctrl in ctrls
