mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-05-04 22:27:10 -04:00
added a hook in server setup for extra initialization
This commit is contained in:
parent
9f0ca7cc44
commit
2d0c3b867a
1 changed files with 18 additions and 0 deletions
|
@ -66,6 +66,8 @@ exports.maxAge = 1000*60*60*6;
|
|||
//set loglevel
|
||||
log4js.setGlobalLogLevel(settings.loglevel);
|
||||
|
||||
function init(additionalSetup){
|
||||
if("function" != typeof additionalSetup) additionalSetup = function(){};
|
||||
async.waterfall([
|
||||
//initalize the database
|
||||
function (callback)
|
||||
|
@ -424,6 +426,20 @@ async.waterfall([
|
|||
});
|
||||
});
|
||||
|
||||
additionalSetup(
|
||||
app, db,
|
||||
{
|
||||
ro: readOnlyManager,
|
||||
pad: padManager,
|
||||
security: securityManager
|
||||
},
|
||||
{
|
||||
"export": exportHandler,
|
||||
"import": importHandler,
|
||||
api: apiHandler
|
||||
}
|
||||
);
|
||||
|
||||
//let the server listen
|
||||
app.listen(settings.port, settings.ip);
|
||||
console.log("Server is listening at " + settings.ip + ":" + settings.port);
|
||||
|
@ -514,3 +530,5 @@ async.waterfall([
|
|||
callback(null);
|
||||
}
|
||||
]);
|
||||
}
|
||||
init(function(){});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue