title: How to use 'require' to import a JSON in NestJS controller?
body: <p>I'm trying to return a json file as a controller response, but I can't get the content of the json.</p>
  
  <pre class="lang-js prettyprint-override"><code>import { Controller, Get, Res, HttpStatus, Query } from '@nestjs/common';
  import { Response } from 'express';
  
  import * as MOCKED_RESPONSE_TS from './data/payment-method.data'; // this ts file is imported fine
  const MOCKED_RESPONSE = require('./data/payment-method-mock'); // this json file is not found
  
  @Controller('commons')
  export class CommonController {
  
  @Get('/payment-method')
    getPaymentMoethod(@Res() res: Response): any {
      res.status(HttpStatus.OK).send(MOCKED_RESPONSE);
    }
  
  }
  </code></pre>
  
  
  
  <blockquote>
    <p>Actually the log returns: <code>Error: Cannot find module './data/payment-method'</code> and the app doesn't compile</p>
  </blockquote>
  
  <p>I have done this with express (even with typescript) and works fine.</p>
  
  <p><em>I don't know if i have to setup my project to read jsons (I'm newby on nest). By the moment I have created a typescript file exporting a const with the json content and I called it successfuly</em></p>