nowjs initialize is not a function

382 Views Asked by At
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);
};

I have a problem with nowjs, with this code it said

var everyone = nowjs.initialize(server);
                     ^
TypeError: nowjs.initialize is not a function

I have no idea why and I've tried to search on Google. No one face this problem.

Reference : https://github.com/Flotype/now

Thank you guys

1

There are 1 best solutions below

1
indieNik On

You might want to check this out - https://github.com/Flotype/now/issues/208

Sad, isn't it? :(