title: API in NextJS that serves a JSON file, can I edit this file (after build, while running) and make the API serve the updated file?
body: <p>Sorry for the wording in the question. Probably my biggest issue with this is not knowing how to phrase it correctly, as I've not been able to gleam a single hint of an answer from google.</p>
  <p>Using api routes in Next.js I want to serve a <code>data.json</code> file. This works no problem, however I also want to be able to edit this file afterwards and for the api to reflect the updated content. As it stands after building and running if I edit the file the api still returns the old one, hell I can even delete it. I assume this is because Next.js makes a copy of the file at build time, and puts it somewhere in the .next directory(?), haven't been able to find it there though.</p>
  <p>Below is a boiled down version of what I'm doing:</p>
  <pre><code>/pages
   /api
    /info.js
  
  /data
    /data.json &lt;- file I want to use with the api
  </code></pre>
  <p><code>pages/api/info.js</code></p>
  <pre class="lang-js prettyprint-override"><code>export default function (req, res) {
    const data = require('../../data/data.json')
    // Do stuff
    res.status(200).json(data.something)
  } 
  </code></pre>
  <p>Any guidance on this is very appreciated</p>