Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
router.get('/downloads*', async (req, res) => {
const proxiedPath = `https://api.npmjs.org${req.path.replace(/^api/, '')}`;
try {
return res.send((await cachios.get(proxiedPath)).data);
} catch (exception) {
console.error(exception);
}
});