Created
November 9, 2010 01:19
-
-
Save qoelet/668571 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
// app.js | |
var connect = require('connect'); | |
var auth= require('connect-auth'); | |
var MyFirstFormStrategy= require('./myFirstFormStrategy'); | |
function routes(app) { | |
app.get('/', function(req, res, params) { | |
req.authenticate(['someName'], function(error, authenticated) { | |
res.writeHead(200, { 'Content-Type': 'text/plain' }); | |
res.end('Hello World'); | |
}); | |
}); | |
} | |
var server = connect.createServer( | |
connect.cookieDecoder(), | |
connect.session(), | |
connect.bodyDecoder(), | |
auth( MyFirstFormStrategy() ), | |
connect.router(routes) | |
); | |
server.listen(3000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment