diff options
author | Arnaud CHESNAY <arnaud.chesnay@etu.univ-nantes.fr> | 2017-09-27 20:13:17 +0200 |
---|---|---|
committer | Arnaud CHESNAY <arnaud.chesnay@etu.univ-nantes.fr> | 2017-09-27 20:13:17 +0200 |
commit | 58d4c4c1b8519e3d6381d7246fe1d446a39d120a (patch) | |
tree | 680bceda9706accc12b0670a132339b0f7a6b2bd | |
parent | images (diff) |
images
-rw-r--r-- | app.js | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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) { |