I have a coding like this
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');
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.