title: NestJs Microservice - Which location do I read files from?
body: <p>Wondering if anyone can help? I am trying to learn how to use NestJS <strong>microservices</strong>. I have managed to succesfully get a microservice with MQTT transport setup to receive events from an API. I am trying to use <a href="https://pugjs.org/api/getting-started.html" rel="nofollow noreferrer">pug</a> to merge the event information with a html template file. However pug cannot find the template file...</p>
  
  <pre><code>  this.logger.info(`Running from dir ${__dirname}`); // /usr/src/app/dist/apps/microservice
    const template = pug.compileFile('../templates/email.pug');
  </code></pre>
  
  <p>I have used a logger to display <em>__dirname</em> which refers to the dist directory. This has the single file main.js inside. How do I bundle and read a template pug file from nestjs microservice?</p>
  
  <p>This <a href="https://stackoverflow.com/questions/56721356/set-basedir-option-for-pug-in-nestjs">post</a> has a similar question, however it is for a nestjs app.</p>