Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
OAE.tenantRouter.on('get', '/api/longurl/expand', async (req, res) => {
const url = decodeURIComponent(req.query.url);
try {
const unshortenedUrl = await tall(url);
const data = {
'long-url': unshortenedUrl
};
return res.status(200).send(data);
} catch (error) {
return res.status(500).send(error.message);
}
});