app.get('/checkFilelink', async (req, res, next) => {
try {
const CancelToken = axios.CancelToken;
const source = CancelToken.source();
setTimeout(() => {
source.cancel('Operation canceled by the user.');
}, 5000);
let url = req.query.url;
var response = await axios.get(url, {
cancelToken: source.token,
progress: false
});
res.json(response);
} catch (e) {
res.send(e)
}
});