This commit is contained in:
Martin Donnelly 2017-08-05 21:58:08 +01:00
parent f0187f14f9
commit 59fd896faa

2
app.js
View File

@ -82,7 +82,7 @@ app.get('/:encoded_id', function(req, res){
Url.findOneAndUpdate({_id: id}, {$inc:{visits:1}}, function (err, doc){
if (doc) {
logger.debug(`Redirect: ${doc.long_url}`);
res.redirect(307, doc.long_url);
res.redirect(doc.long_url);
} else {
res.redirect(config.webhost);
}