aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud CHESNAY <arnaud.chesnay@etu.univ-nantes.fr>2017-09-27 20:09:11 +0200
committerArnaud CHESNAY <arnaud.chesnay@etu.univ-nantes.fr>2017-09-27 20:09:11 +0200
commit9145b36261be8415bc70967c4dad2745f4cb10ac (patch)
tree74f06df8e5db82f703e59e02037567ae6cc2581c
parentimages (diff)
images
-rw-r--r--app.js6
1 files changed, 1 insertions, 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) {