Pita/etherpad-lite — pull request #345 by guybrush (2012-01-21 08:53:56+00:00)
Title: make the app mountable

this is not meant to be merged yet, it is an approach to make the etherpad-lite-app mountable into other express-apps.

right now it feels SUPER-hacky - but works

with the current patch, one can mount the etherpad like that:

var app = require('express').createServer()
var pad = require('etherpad-lite/node/server.js')
app.use('/pad', pad.helpExpress(
{ basepath : '/pad'
, settings :
{ dbType: 'dirty'
, dbSettings: { filename: '/home/patrick/pad.db' }
, defaultPadText : 'blub'
, minify : true
, abiword : null
, loglevel: 'INFO'
}
}
))
app.listen(5000)

* handling of settings is really bad right now :p
* the `basepath` passed to the `helpExpress` **must** match the route where you mount the etherpad (`/pad` in my example)
* i dont know what happens when the app which mounts the etherpad already uses socket.io

anyway - this is how i use etherpad-light right now, would love to hear what you are thinking about it