Defining a class in Node.js
<p>I am trying to make a model class in Node.js and am having some trouble.</p>
<hr />
<h1>Code:</h1>
<blockquote>
<p>MosaicStreamer.js</p>
</blockquote>
<p>This is how I'm trying to define the class.</p>
<pre><code>function MosaicStreamer() {
    
}

module.exports = MosaicStreamer; 
</code></pre>
<blockquote>
<p>App.js</p>
</blockquote>
<pre><code>app.get('/map', function(req, res){
    'use strict'; 
    var models = require('./models/MosaicStreamer.js'); 
    var mosaic_streamer = new MosaicStreamer; 
    res.render('view', {type: &quot;block&quot;, name: &quot;Sara&quot;, latitude: &quot;&quot;, longitude: &quot;&quot;, zoom: &quot;&quot;}); 
}); 
</code></pre>
<p>Here I am trying to create an instance of the <code>MosaicStreamer</code> class.</p>
<hr />
<h1>Error:</h1>
<p>I keep getting:</p>
<blockquote>
<p>ReferenceError: MosaicStreamer is not defined</p>
</blockquote>
<p>The stack trace points to <code>var mosaic_streamer = new MosaicStreamer;</code> in <code>app.js</code>.</p>
<p>What am I doing wrong?</p>