diff options
author | Arnaud CHESNAY <arnaud.chesnay@etu.univ-nantes.fr> | 2017-09-27 20:09:11 +0200 |
---|---|---|
committer | Arnaud CHESNAY <arnaud.chesnay@etu.univ-nantes.fr> | 2017-09-27 20:09:11 +0200 |
commit | 9145b36261be8415bc70967c4dad2745f4cb10ac (patch) | |
tree | 74f06df8e5db82f703e59e02037567ae6cc2581c | |
parent | images (diff) |
images
-rw-r--r-- | app.js | 6 |
1 files changed, 1 insertions, 5 deletions
@@ -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) { |