Permalink
Browse files

Added unique tracking

  • Loading branch information...
1 parent f2b0de6 commit 4c6308941d1a29d771f5d9740b7234c896041373 @thinkroth committed Jan 10, 2012
Showing with 5 additions and 4 deletions.
  1. +5 −4 short.js
View
@@ -30,11 +30,12 @@ app.get('*', function (req, res) {
if (req.url === '/favicon.ico') {
return;
}
- var hash = req.url.slice(1);
- short.retrieve(hash, function (error, shortURLObject) {
+ var visitor = req.connection.remoteAddress,
+ hash = req.url.slice(1),
+ options = {visitor: visitor};
+ short.retrieve(hash, options, function (error, shortURLObject) {
if (error) {console.error(error);
- }
- else {
+ } else {
if (shortURLObject) {
res.redirect(shortURLObject.URL, 302);
}

0 comments on commit 4c63089

Please sign in to comment.