From 772069d3b45295fba916e08f955774cedc1fa733 Mon Sep 17 00:00:00 2001 From: Scott Rahner Date: Tue, 5 Jul 2011 23:46:52 -0400 Subject: [PATCH] more docs --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index eece56e..3aee505 100644 --- a/README.md +++ b/README.md @@ -18,11 +18,22 @@ You have a complete example on `example/index.js`. var connect = require('connect') var sessionStore = require("connect-mongoose")(express); + var http = require('http'); var server = express.createServer(express.cookieParser(), express.session({ secret : "secret", store : new sessionStore() })); + + mongoose.connection.on("open", function() { + http.createServer(function (req, res) { + res.writeHead(200, {'Content-Type': 'text/plain'}); + response.write(req.session); //this is your session object + res.end('Hello World\n'); + }).listen(1337, "127.0.0.1"); + }); + + mongoose.connect("mongodb://localhost/dev"); ## Tests