title: How to send file with fastify & nestjs?
body: <p>I have the following front end middleware:</p>
  
  <pre><code>export class FrontendMiddleware implements NestMiddleware {
      use(req: any, res: any, next: () =&gt; void) {
          const url = req.originalUrl;
          if (url.indexOf('rest') === 1) {
              next();
          } else if (allowedExt.filter(ext =&gt; url.indexOf(ext) &gt; 0).length &gt; 0) {
              res.sendFile(resolvePath(url));
          } else {
              res.sendFile(resolvePath('index.html'));
          }
      }
  } 
  </code></pre>
  
  <p>It works fine with express, but with fastify, <code>res.sendFile</code> is <code>undefined</code>, so how can I fix that?</p>