Closed fecabianchi closed 7 years ago
I manage to make this work with regex
i'll write what i did for help next ppl
first i made the route name more specific
router.get('/download/:id', (req, res) => {
File
.findOne({ _id: req.params.id })
.then(file => res.download(`${__dirname}/../files/${file.fileName}`, `${file.originalName}`))
.catch(err => res.json(err))
})
then i write a regex for unless
app.use(jwt({ secret:'secret' }).unless({
path: [
{ url: /\/api\/file\/download/i },
]
}))
I have a route for downloading files
i want to use unless on that route but this route have params and unless did not support that.
how can i unless that route?
Thanks in advance.