title: now.js - Hello World example - "require not defined"
body: <p>I'm having trouble getting the <a href="http://nowjs.com/examples/hw" rel="nofollow">now.js chat client tutorial</a> to work. (I've also followed <a href="http://vimeo.com/20936525#at=0" rel="nofollow">this video</a> almost exactly).</p>
  
  <h3>server.coffee:</h3>
  
  <pre><code>fs = require 'fs'
  http = require 'http'
  now = require 'now'
  
  server = http.createServer (req, res) -&gt;
      fs.readFile(
          'index.html'
          (err, data) -&gt;
              res.writeHead(
                  200
                      'Content-Type': 'text/html'
                  )
              res.end(data)
          )
  server.listen 8080
  
  everyone = now.initialize(server)
  
  everyone.now.distributeMessage = (msg) -&gt;
      everyone.now.receiveMessage(@.now.name, msg)
  </code></pre>
  
  <h3>index.html:</h3>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;nowjs title&lt;/title&gt;
          &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript" src="https://raw.github.com/Flotype/now/master/lib/now.js"&gt;&lt;/script&gt;
  
          &lt;script type="text/javascript"&gt;
          $(document).ready(function() {
              now.name = prompt("What's your name?", "");
              now.receiveMessage = function(name, msg) {
                return $("&lt;div&gt;&lt;/div&gt;").text("" + name + ": " + msg).appendTo("#msg");
              };
              return $("#send-button").click(function() {
                now.distributeMessage($("#text-input").val());
                return $("#text-input").val("");
              });
            });
          &lt;/script&gt;
      &lt;/head&gt;
  
      &lt;body&gt;
          &lt;div id="msg"&gt;&lt;/div&gt;
  
          &lt;input type="text" id="text-input"&gt;
          &lt;input type="button" value="Send" id="send-button"&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>When I load up the server with <code>node server.js</code>,</p>
  
  <p>I get an error that says "require not defined" on line 1 of now.js. Consequently, the client side code can't find the variable 'now'.</p>
  
  <p>I understand that 'require' is a node function, but how do I get the client to understand that?</p>
  
  <p>Any help will be appreciated.</p>