mirror of
/repos/Prototyper.git
synced 2025-12-30 06:31:32 +01:00
20 lines
397 B
JavaScript
20 lines
397 B
JavaScript
'use strict';
|
|
var ShareJS = require('share');
|
|
|
|
module.exports = function (config, app, db) {
|
|
// share wraps express app with http.Server
|
|
if (config &&
|
|
config.share &&
|
|
config.share.db &&
|
|
config.share.db.type === 'mongo') {
|
|
config.share.db.client = db;
|
|
}
|
|
var server = ShareJS.server.attach(app, config.share);
|
|
var model = app.model;
|
|
|
|
return {
|
|
server: server,
|
|
model: model
|
|
};
|
|
};
|