   if fs.existsSync filename
     return serveFile filename, res
 
-  http.get fullUrl, (response)->
+  http.get fullUrl, (response) ->
     response.pipe(fs.createWriteStream(filename)).on 'close', ->
       serveFile filename, res

  unless url.pathname?
    return res.status(500).end()

  ext   = url.pathname.split(".")[-1] or "jpeg"
  noExt = "#{url.host}#{url.pathname}"

  # arbitary limit to prevent ENAMETOOLONG errors

  }
} = KONFIG

imagePath = 'embedly_cache'

fs.mkdir imagePath, null, ->

module.exports = (req, res) ->
  { endpoint, grow, width, height, url } = req.query

  fullUrl = "https://i.embed.ly/1/display/#{endpoint}?" +
             "width=#{width}&" +
