Server Side code,
var express = require('express'); //Web Framework
var app = express();
var http = require('http').Server(app); //HTTP server module
var connect = require('connect'),
sharejs = require('share').server;
app.use(function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
next();
});
var options = {db: {type: 'none'}}; // See docs for options. {type: 'redis'} to enable persistance.
// Attach the sharejs REST and Socket.io interfaces to the server
sharejs.attach(server, options);
app.get('/', function (req, res) {
res.sendFile('index.html', { root: __dirname });
})
http.listen(3000, function () {
console.log('listening on *:3000');
});
But I cant get the share.js to work.
It gives an error, ReferenceError: server is not defined
How do I get express to work along with share.js?