Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
app.use(function(req, res, next) {
if(req.query.q) {
res.redirect('/search/' + req.query.q)
}
try {
reactAsync.renderToStringAsync(reactApp.routes({path: req.path}), function(err, markup) {
if(err) {
return next()
}
return res.send('' + markup.replace('%react-iso-vgs%', reactApp.title.rewind()))
})
} catch(err) {
return next()
}
})