var express = require('express');
var app = express();
var nowjs = require('now');
app.get('/', function(req, res) {
res.send('index');
});
var server = app.listen(4000);
/* Initialing now.js for broadcast the functions */
var everyone = nowjs.initialize(server);
everyone.now.sendMessage = function(message) {
everyone.now.receiveMessage(message);
};
我对nowjs有问题,用这段代码说
var everyone = nowjs.initialize(server);
^
TypeError: nowjs.initialize is not a function
我不知道为什么,我试图在Google上搜索。没有人面对这个问题。
参考:https://github.com/Flotype/now
谢谢你们