title: Trying to run a script with Express on localhost:3000
body: <p>Stuck on my first attempt at a basic app. Scraper.js scrapes a URL and writes the returned array to the document obj when run alone in console, so that part works. Now all I want is an Express server to run the script whenever I open localhost:3000 but not sure how to do so.</p>
  
  <pre><code>|node_modules
  |package.json
  |public
  |-index.html  (boilerplate HTML. Not importing anything)
  |src
  |-scraper.js
  |index.js
  </code></pre>
  
  <p>index.js:</p>
  
  <pre><code>var scraperjs = require('scraperjs');
  var express = require('express');
  var app = express()
  
  app.use(express.static(__dirname + '/public'));
  app.listen(3000); 
  </code></pre>
  
  <p>--</p>
  
  <p>scraper.js:</p>
  
  <pre><code>scraperjs.StaticScraper.create('https://examplesite.com/')
      .scrape(function($) {
          return $(".entry-content p").map(function() {
                var content =  $(this).html();
                return content
              }
         }).get();
      })
      .then(function(data) {
          ... // eventually will write the items returned from the data array to div's
          } 
   });
  </code></pre>