Skip to content

Instantly share code, notes, and snippets.

@sh1mmer
Created May 18, 2011 14:20
Show Gist options
  • Save sh1mmer/978658 to your computer and use it in GitHub Desktop.
Save sh1mmer/978658 to your computer and use it in GitHub Desktop.
Request Skeleton
//Server CommonJS Module Skeleton
var sys = require('sys'),
EE = require('events').EventEmitter;
var Server = exports.Server = function() {
//Server Setup
};
sys.inherits(Server, EE);
Server.prototype.Request = function() {
//Request Setup
};
sys.inherits(Sever.prototype.Request, EE);
Server.prototype._createRequest = function(in, out) {
//Request Factory
return new this.Request();
};
exports.createServer = function() {
//Server Factory
return new Server();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment