Permalink
Browse files

express example app-style

  • Loading branch information...
1 parent 482e50a commit 3faf400219dd1bcde01a35c26fd0811c8baaeb4e @substack committed Feb 11, 2011
Showing with 13 additions and 0 deletions.
  1. +13 −0 examples/memory-express-app.js
@@ -0,0 +1,13 @@
+var express = require('express');
+var app = express.createServer();
+app.use(require('sesame')());
+
+app.get('/', function (req, res) {
+ req.session.times = (req.session.times || 0) + 1;
+
+ res.writeHead(200, { 'Content-Type' : 'text/plain' });
+ res.end(req.session.times + ' times!');
+});
+
+console.log('Listening on 9090');
+app.listen(9090);

0 comments on commit 3faf400

Please sign in to comment.