title: node app.js results in "window not defined"
body: <p>From research in <a href="https://stackoverflow.com/questions/37250121/how-to-solve-window-is-not-defined-error-in-node-js-on-terminal">this Stack Overflow post</a>, I understand that this has to do with <code>window</code> being defined in the browser and not in <code>node</code>. However, I'm not entirely clear on how to remedy the situation. My goal is to just start my server so I can preview a website I built (and make sure it looks good).</p>
  
  <p>Here's my app.js file:</p>
  
  <pre><code>var app = require('express')();
  var server = require('http').Server(app);
  var io = require('socket.io')(server);
  
  server.listen(80);
  
  app.get('/', function (req, res) {
    res.sendfile(__dirname + '/index.html');
  });
  
  io.on('connection', function (socket) {
    socket.emit('answers', { hello: 'world' });
    socket.on('gum', function (data) {
      console.log(data);
  });
  });
  
  angular.module('NoteWrangler', ['ngRoute', 'ngResource']);
  </code></pre>
  
  <p>Here's the error I get when entering node app.js into Terminal:</p>
  
  <pre><code>/Users/Kristin/node_modules/angular/angular.js:26057
  })(window, document);
     ^
  
  ReferenceError: window is not defined
  at Object.&lt;anonymous 
  (/Users/Kristin/node_modules/angular/angular.js:26057:4)
  at Module._compile (module.js:570:32)
  at Object.Module._extensions..js (module.js:579:10)
  at Module.load (module.js:487:32)
  at tryModuleLoad (module.js:446:12)
  at Function.Module._load (module.js:438:3)
  at Module.require (module.js:497:17)
  at require (internal/module.js:20:19)
  at Object.&lt;anonymous&gt; (/Users/Kristin/node_modules/angular/index.js:1:63)
  at Module._compile (module.js:570:32)
  </code></pre>