This commit is contained in:
Martin Donnelly 2017-08-05 21:37:51 +01:00
parent 7e8dad9b38
commit d5457ddd9d

2
app.js
View File

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