equal
deleted
inserted
replaced
3 |
3 |
4 var app = express(); |
4 var app = express(); |
5 app.use(cookie()); |
5 app.use(cookie()); |
6 |
6 |
7 app.get('/', function(req, res){ |
7 app.get('/', function(req, res){ |
8 var counter = parseInt(req.cookies.counter) || 0; |
8 var counter = parseInt(req.cookies.counter || "") || 0; |
9 res.cookie('counter', counter + 1); |
9 res.cookie('counter', counter + 1); |
10 if (counter >= 5) { |
10 if (counter >= 5) { |
11 res.write('You are a valued customer ' + |
11 res.write('You are a valued customer ' + |
12 'visting the site ' + counter + ' times.'); |
12 'visting the site ' + counter + ' times.'); |
13 } else { |
13 } else { |