Skip to content

Instantly share code, notes, and snippets.

@qoelet
Created November 9, 2010 01:19
Show Gist options
  • Save qoelet/668571 to your computer and use it in GitHub Desktop.
Save qoelet/668571 to your computer and use it in GitHub Desktop.
// 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