title: How to set environment variable for hosting and port
body: <p>I have a coding like this </p>
  
  <pre><code>var express = require('express');
  var app=express();
  var mongodb = require('mongodb');
  var Db=require('mongodb').Db;
  var Server=require('mongodb').Server;
  var client=new Db('healthdata' , new Server('127.0.0.1',27017),{safe:false});
  
  client.open(function(err,pClient)
  {
    client.collection('userdetails',function(err,collection)
    {
      Ucollection=collection;
    });
  });
  
  app.listen(8080,'192.168.0.1');
  </code></pre>
  
  <p>I have run my application by using port and local ip address like above so how to set environment variable for hostnames and port for both node and mongodb. explain me with coding.  </p>