josephg / ShareJS

Collaborative editing in any app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sharejs 0.6 with express4

zcfrank1st opened this issue · comments

use sharejs 0.6 with express, always get erro... the sharejs cannot be correct loaded on client side, it comes out:

Resource interpreted as Script but transferred with MIME type text/html: "http://localhost:3000/channel/bcsocket.js". localhost/:170
Resource interpreted as Script but transferred with MIME type text/html: "http://localhost:3000/share/textarea.js". localhost/:172
Resource interpreted as Script but transferred with MIME type text/html: "http://localhost:3000/share/share.js". localhost/:171
Uncaught SyntaxError: Unexpected token < bcsocket.js:1
Uncaught SyntaxError: Unexpected token < share.js:1
Uncaught SyntaxError: Unexpected token < textarea.js:1
Uncaught ReferenceError: sharejs is not defined (index):18

my client side is like the demo in the get started doc

and server side:

var sharejs = require('share').server;
var options = {db: {type: 'none'}};

var app = express();

......

var server = http.createServer(app);

sharejs.attach(app, options);

server.listen(app.get('port'), function () {
console.log('Express server listening on port ' + app.get('port'));
});

Works fine for me, please post your question in the discussion forum and try to send in your code as well:
https://groups.google.com/forum/#!forum/sharejs

@hatpick ok,thank you!

It's not working for me as well.
I am using sharejs v0.6.3 and express v4.9.0.. The client complains 404 not found error: "channel/test?VER=8&MODE=init&zx=poz74x2qr848&t=1" .
If I switch express to version 3.4.8, everything is working fine.