From 9145b36261be8415bc70967c4dad2745f4cb10ac Mon Sep 17 00:00:00 2001 From: Arnaud CHESNAY Date: Wed, 27 Sep 2017 20:09:11 +0200 Subject: images --- app.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app.js b/app.js index 23d9fe3..8443bc8 100644 --- a/app.js +++ b/app.js @@ -31,11 +31,7 @@ app.get('/data', function(req, res) { }); app.get('/img/*', function (req, res) { - fs.readFile(path + req.url.replace('/img', ''), 'utf8', function(err, data) { - if (err) - return console.log(err); - res.send(data); - }); + res.sendFile('/' + path + req.url.replace('/img', '')) }); app.get('/', function(req, res) { -- cgit v1.2.3