title: Serving json from a file express js
body: <p>Newbie to express, I have a folder that has a db.json file and it gets replaced with a new db.json every 11 seceonds. What is the best way to let express.js serve it so that new content shows on api call? This is what I have so far:</p>
  
  <pre><code>const express = require('express');
  const router = express.Router();
  
  router.get('/api/items', (req, res) =&gt; {
    let dbPath = require('./data/db.json');
    res.send(JSON.stringify(dbPath));
  
  });
  </code></pre>
  
  <p>db.json looks something like this</p>
  
  <pre><code>[{"recordType": "E90", "count": "55", "space": "4" },
  {"recordType": "A48", "count": "40", "space": "5" }, ....]
  </code></pre>
  
  <p>Problem: I'm not seeing the updated value next time I make the api call.</p>