title: How to run a module on NodeJS?
body: <p>I am quite new to NodeJS. At the moment, the server code is as below:</p>
  <p>//app.js</p>
  <pre><code>var express = require('express');
  var app = express();
  
  app.use(express.static(__dirname + '/app'));
  
  app.listen(process.env.PORT || 8080);
  console.log(&quot;Listening on port 8080&quot;);
  </code></pre>
  <p>I have the following code that I am interested to run on server:</p>
  <p>//strava.js</p>
  <pre><code>var strava = require('node-strava-v3');
  
  strava.streams.activity({'id':444215395, 'types':'heartrate'}, function(err, payload){
      if(!err){
          console.log(payload);
      }
      else{
          console.log(err);
      }
  })
  </code></pre>
  <p>(For now I have hardcoded the data in the parameter)</p>
  <h3>Questions</h3>
  <ol>
  <li><p>How do I run Strava when the server is started?</p>
  </li>
  <li><p>How do I make payload available for the client?</p>
  </li>
  </ol>
  <p>Thank you kindly.</p>