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