Skip to content

Instantly share code, notes, and snippets.

@jcrugzz

jcrugzz/test.js Secret

Last active December 21, 2015 15:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jcrugzz/38c08b14d91e4a19f60f to your computer and use it in GitHub Desktop.
Save jcrugzz/38c08b14d91e4a19f60f to your computer and use it in GitHub Desktop.
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