-
-
Save yanCode/5948505 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express') | |
, cookieSessions = require('./cookie-sessions'); | |
var app = express(); | |
app.use(express.cookieParser('manny is cool')); | |
app.use(cookieSessions('sid')); | |
app.get('/', function(req, res){ | |
req.session.count = req.session.count || 0; | |
var n = req.session.count++; | |
res.send('viewed ' + n + ' times\n'); | |
}) | |
app.listen(3000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fixed a bug from the original, which is more likely a typo, yet it blocked the startup.