title: Environment variable not being picked up by Node/Express/Nuxt app
body: <p>I am trying to setup SendGrid with my Vue/Nuxt app, however I can only get it to to work by hardcoding the API key. When I try to use the preferred environment variable method, I get an <strong>unauthorized error</strong>. This is because the app is not picking up the variable, instead it returns <em>Undefined</em>.</p>
  
  <p>How do I make the app get the variable?</p>
  
  <p>My API KEY is kept in a filed called <strong>sendgrid.env</strong> in the project root.</p>
  
  <p>I then have a Node/Express app running within my Nuxt project with the following code:</p>
  
  <pre><code>const express = require('express')
  const app = express()
  
  app.get('/', (req, res, next) =&gt; {
    res.send('API root')
  })
  
  app.get('/sendmail', (req, res, next) =&gt; {
  
  // using Twilio SendGrid's v3 Node.js Library
  // https://github.com/sendgrid/sendgrid-nodejs
  const sgMail = require('@sendgrid/mail');
  sgMail.setApiKey(process.env.SENDGRID_API_KEY);
  
  const msg = {
      to: 'somebody@something.net',
      from: 'no-reply@somewhereelse.com',
      subject: 'Test SendGrid',
      text: 'This is a test of the SendGrid app on Node',
      html: '&lt;strong&gt;This is a test of the SendGrid app on Node&lt;/strong&gt;',
  };
  
  sgMail.send(msg);
  
  res.send('SendMail API');
  
  })
  
  // export the server middleware
  module.exports = {
    path: '/api',
    handler: app
  }
  </code></pre>
  
  <p>I have tested the code using Curl and also by hardcoding the API Key, so the key is correct, it's just the environment variable that's not being picked up.</p>
  
  <p>What am I doing wrong?</p>