Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
app.post('/extract', function(req, res) {
var url = req.body.url;
console.log(`Extracting technologies for ${url}`);
if (validUrl.isUri(url)) {
wappalyzer.run([url, '--quiet'], function(stdout, stderr) {
if(stderr) {
res.status(400).send(stderr);
}
else if(stdout) {
res.send(stdout);
}
});
} else {
res.status(422).end();
}
});