From 58d4c4c1b8519e3d6381d7246fe1d446a39d120a Mon Sep 17 00:00:00 2001 From: Arnaud CHESNAY Date: Wed, 27 Sep 2017 20:13:17 +0200 Subject: images --- app.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app.js b/app.js index 8443bc8..fbd1045 100644 --- a/app.js +++ b/app.js @@ -31,7 +31,9 @@ app.get('/data', function(req, res) { }); app.get('/img/*', function (req, res) { - res.sendFile('/' + path + req.url.replace('/img', '')) + var img = fs.readFileSync(path + req.url.replace('/img', '')); + res.writeHead(200, {'Content-Type': 'image/gif' }); + res.end(img, 'binary'); }); app.get('/', function(req, res) { -- cgit v1.2.3