title: UnhandledPromiseRejectionWarning: Error: URI does not have hostname, domain name and tld
body: <p>I am following a tutorial by Wes Bos, Learn Node.js.</p>
  
  <p>I downloaded all the starter files and created a database with MongoDb Atlas.</p>
  
  <p>When I run npm start I get this error:</p>
  
  <pre><code>UnhandledPromiseRejectionWarning: Error: URI does not have hostname, domain name and tld
  DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
  </code></pre>
  
  <p>I am using an environment variable to connect to the database</p>
  
  <pre><code>mongoose.connect(process.env.DATABASE);
  </code></pre>
  
  <p>and the variable looks like this: </p>
  
  <pre><code>DATABASE=mongodb+srv://&lt;username&gt;:&lt;password&gt;@cluster1-rgvum.mongodb.net/test?retryWrites=true
  </code></pre>
  
  <p>I omitted my username and password for obvious reasons. If anyone has any idea how to proceed it would be much appreciated! Thank you.</p>