-fs   = require "fs"
-http = require "https"
-mime = require "mime"
+fs     = require "fs"
+http   = require "https"
+mime   = require "mime"
+crypto = require "crypto"
 
 {
   embedly : {

             "key=#{apiKey}&" +
             "url=#{url}"

  filename = "#{imagePath}/#{url.split('/').join('_')}"

  serveFile = (filename, res)->
    fileStream = fs.createReadStream filename


    mimeType = mime.lookup filename

    res.writeHead(200, { 'Content-Type': mimeType });

  if fs.existsSync filename
    return serveFile filename, res
