title: _dirname is not defined? app.use(express.static(path.join(_dirname, 'public')));
body: <p>How do I make this heart appear in my console? I have an .env file with PORT=3001 written in it. And I removed bodyParser because it was deprecated and apparently it is built into express now.</p>
  <p>The error I'm getting is that _dirname is not defined</p>
  <pre><code>// Require
  require('dotenv').config();
  const express = require('express');
  const ejs = require('ejs');
  const path = require('path');
  const morgan = require('morgan');
  const helmet = require('helmet');
  // App
  const app = express();
  // Middlewares
  // Morgan
  app.use(morgan('dev'));
  // View engine ejs
  app.set('view engine', 'ejs');
  //Public static folder
  app.use(express.static(path.join(_dirname, 'public')));
  // Body Parser (replaced with express)
  app.use(express.urlencoded({
      entended: false
  }));                     
  app.use(express.json()); 
  // Helmet
  app.use(helmet());
  // External routes
  
  
  
  
  // Listener
  let PORT = process.env.PORT || 3000;
  app.listen(PORT, () =&gt; {
      console.log('Server beating  on PORT (PORT)');
  })
  </code></pre>