-
-
Save jcrugzz/38c08b14d91e4a19f60f to your computer and use it in GitHub Desktop.
This file contains 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 http = require('http'); | |
var test = function () { | |
this.db = setupDb() | |
this.server = http.createServer(this._requestHandler.bind(this)); | |
}; | |
test.prototype._requestHandler = function (req, res) { | |
this.db.getData(function (err, data) { | |
res.end(JSON.stringify(data)); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment