diff --git a/examples/downloads/index.js b/examples/downloads/index.js index c47dddd738..228755402e 100644 --- a/examples/downloads/index.js +++ b/examples/downloads/index.js @@ -21,8 +21,8 @@ app.get('/', function(req, res){ '') }); -// /files/* is accessed via req.params[0] -// but here we name it :file +// /files/*file works only on express 5.x +// for more information checking wildcard parameters of path-to-regexp app.get('/files/*file', function (req, res, next) { res.download(req.params.file.join('/'), { root: FILES_DIR }, function (err) { if (!err) return; // file sent