Skip to content

Instantly share code, notes, and snippets.

@jazlalli
Last active December 12, 2015 10:09
Show Gist options
  • Save jazlalli/4757499 to your computer and use it in GitHub Desktop.
Save jazlalli/4757499 to your computer and use it in GitHub Desktop.
config object for housing node-sqlserver connection string and its parsed elements
var config_development = {}
config_development.CLOUD_AMQP = 'amqp://127.0.0.1:5672';
config_development.EXCHANGE_NAME = 'DataExchange';
config_development.QUEUE_NAME = 'SqlSubscriberQueue';
config_development.SQL = {};
config_development.SQL.ConnectionString = 'Driver={SQL Server Native Client 10.0};Server=(local);Database=Reporting;Trusted_Connection={Yes}';
var parsesqlconnectionstring = (function () {
var i,
properties = config_development.SQL.ConnectionString.split(';'),
propertycount = properties.length,
keyvalue;
for (i = 0; i < propertycount; i += 1) {
keyvalue = properties[i].split('=');
config_development.SQL[keyvalue[0]] = keyvalue[1];
}
}());
module.exports = config_development;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment