Flotype / now

NowJS makes it easy to build real-time web apps using JavaScript
http://www.nowjs.com
MIT License
1.91k stars 175 forks source link

NowJS and Express #146

Closed thalesfsp closed 13 years ago

thalesfsp commented 13 years ago

Hi! I'm trying to use NowJS with ExpressJS.

In the serve i do:

var express = require('express'),
    app = module.exports = express.createServer(),
    connect = require('connect'),
    jade = require('jade'),
    mongoStore = require('connect-mongodb'),
    nowjs = require("now"),
    everyone = nowjs.initialize(app); // initialize the sync

everyone.now.test = 'test';

in the client i do (in Jade):

script
  now.ready(function(){
    console.log(now.teste);
  });

In the console i get:

undefined

Where i'm wrong?

steveWang commented 13 years ago

now.tests versus now.test ?

ericz commented 13 years ago

Hi thalesfsp, there is nothing wrong with your code. If the issue is not the typo noted by steveWang, feel free to reopen the issue.

Eric