From 423d96095eef3162521457172fc39295217ba42c Mon Sep 17 00:00:00 2001 From: lucaswadedavis Date: Wed, 21 Dec 2016 14:11:34 -0800 Subject: [PATCH] Remove unused directories and functions. --- images/.placeholder | 0 server.js | 26 ++------------------------ 2 files changed, 2 insertions(+), 24 deletions(-) delete mode 100644 images/.placeholder diff --git a/images/.placeholder b/images/.placeholder deleted file mode 100644 index e69de29..0000000 diff --git a/server.js b/server.js index 43d96dc..994664d 100644 --- a/server.js +++ b/server.js @@ -3,6 +3,7 @@ try { } catch (e) { console.error("WARNING unable to load newrelic") } + var fs = require('fs'); var express = require('express'); var uuid = require('uuid/v4'); @@ -21,35 +22,12 @@ function composeImage(width, height, seed) { return canvas; }; -function writeFoxToDisk (canvas, nameSuffix) { - var fileName = "fox-" + nameSuffix + ".png"; - var filePath = __dirname + '/images/' + fileName; - - fs.writeFile(filePath, canvas.toBuffer(), function(err) { - if (err) console.log('error', err); - }); - - return fileName; -}; - -function writeFoxesToDisk (width, height, n=10) { - var fileNames = []; - for (var i = 0; i < n; i++) { - var seed = uuid(); - var canvas = composeImage(width, height, seed); - fileNames.push(writeFoxToDisk(canvas, seed)); - } - return fileNames; -}; - var app = express(); -app.use(express.static(__dirname + '/images')); - var cacheTimeout = 60 * 60 * 24 * 30; app.get('/healthcheck', function(req, res) { - res.status(200).end(); + res.status(200).end(); }); app.get('/:width/:seed', function(req, res) {