Created
March 12, 2014 10:14
-
-
Save txm/9504188 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var db = (function(){ | |
var mysql = require('mysql'); | |
var host = 'localhost'; | |
var database = 'me'; | |
var password = ''; | |
var user = 'root'; | |
return { | |
get_dbh: function () { | |
var connection = mysql.createConnection({ | |
host : host, | |
database : database, | |
password : password, | |
user : user | |
}); | |
return connection; | |
} | |
}; | |
})(); | |
~ | |
~ | |
"db.js" 26L, 410C written |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var db = require('./db.js'); | |
console.log(db); | |
process.kill(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Andy-MacBook:twitter-stream andy$ node run.js start | |
{} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment