-
Notifications
You must be signed in to change notification settings - Fork 4
Home
mrmarbles edited this page May 14, 2011
·
14 revisions
Welcome to the komainu wiki!
npm install komainu
With Connect;
var connect = require('connect'),
komainu = require('komainu');
var sp = komainu.createSecurityProvider();
sp.addCredentials('test', 'test', 'LOGGED_IN_USER') // test purposes only
connect.createServer(
connect.cookieParser(),
connect.session({secret:'mySecretKey'}),
sp.secure()
).listen(3000);
With ExpressJS
var express = require('express'),
komainu = require('komainu');
var app = module.exports = express.createServer();
var sp = komainu.createSecurityProvider();
sp.addCredentials('test', 'test', 'LOGGED_IN_USER'); // test purposes only
app.configure(function() {
app.use(express.cookieParser());
app.use(express.session({secret:'mySecretKey'}));
app.use(sp.secure());
});
app.listen(3000);