Currently I have a file called router.js set up as follows:
var Server = require(\'mongodb\').Server;
var MongoDB = require(\'mongodb\').Db;
var dbPort = 31979;
You could store your config as a JSON file and read it directly:
config.json
{
"dbPort": 31979,
"dbHost": "40.117.155.19",
"dbName": "node-login"
}
router.js
var Server = require('mongodb').Server;
var MongoDB = require('mongodb').Db;
var CONFIG = require('./config.json');
var dbPort = CONFIG.dbPort;
var dbHost = CONFIG.dbHost;
var dbName = CONFIG.dbName;