Skip to content

Instantly share code, notes, and snippets.

@julianshen
Created December 27, 2011 13:29
Show Gist options
  • Save julianshen/1523666 to your computer and use it in GitHub Desktop.
Save julianshen/1523666 to your computer and use it in GitHub Desktop.
var thrift = require('thrift');
var Computer = require('./gen-nodejs/Computer.js'),
ttypes = require('./gen-nodejs/computer_types.js');
var server = thrift.createServer(Computer, {
add: function(a, b, callback) {
console.log("function called:", a+b);
callback(a+b);
},
});
server.listen(6116);
console.log('Server started at port 6116');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment