title: Node.js export both router and function
body: <p>I'm exporting router at the end of the file and also exporting a function, but I can only get one of them to work at a time.</p>
  
  <pre><code>// weather.js
  var express = require('express');
  var router = express.Router();
  
  refreshWeather(){
  // Refresh weather...
  }
  
  exports = router; // It's either this
  exports.refresh = function() { // or this.
      refreshWeather();
      console.log('Done refreshing');
  };
  </code></pre>
  
  <p>from my main app.js I want to be able to do both:</p>
  
  <pre><code>//app.js
  var express = require('express');
  var app = express();
  
  var weather = require('./routes/weather.js');
  
  app.use(weather) // I want to be able to use this for routing
  weather.refresh(); // But also be able to call refresh function of weather.js
  </code></pre>