diff options
author | Arnaud CHESNAY <arnaud.chesnay@etu.univ-nantes.fr> | 2017-09-27 19:52:33 +0200 |
---|---|---|
committer | Arnaud CHESNAY <arnaud.chesnay@etu.univ-nantes.fr> | 2017-09-27 19:52:33 +0200 |
commit | 85d92cf45f8d4ce3fc860dc7ed27701cdddc10af (patch) | |
tree | 67d62de72553d67d301cd99428795f689d73b93f | |
parent | 404 (diff) |
images
-rw-r--r-- | app.js | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -30,6 +30,10 @@ app.get('/data', function(req, res) { res.send(dirTree(path, {extensions:/\.md/})); }); +app.get('/img/*', function (req, res) { + res.sendFile(req.url.replace('/img/', '')); +}); + app.get('/', function(req, res) { fs.readFile('public/index.html', 'utf8', function(err, data) { if (err) @@ -57,7 +61,7 @@ app.get('*', function(req, res) { }); }); -var server = app.listen(80, function() { +var server = app.listen(8080, function() { var host = server.address().address; var port = server.address().port; console.log("App listening at http://%s:%s", host, port); |