I have data (JSON) in a file that I want to expose through an API. I know the data at build time but I don't know how to create static API routes or even expose the files through the API routes statically.

I googled two solutions for this:

* Create a static page that returns a JSON file (couldn't find a solution, it always returned HTML).
* Use the pages/api/[something] to generate the API (but it seems to always be dynamic).

My last resort is to try to access the file through the function on the /pages/api/[something].js but this is dynamic and not static.

The dynamic function that comes by default in /pages/api/hello.js folder:

```js
export default (req, res) => {  
  res.statusCode = 200;
  res.json({ name: "John Doe" });
};

```

What is the typical strategy here? I feel that I'm missing something.