Skip to content

Instantly share code, notes, and snippets.

@tim-smart
Created February 28, 2010 03:23
Show Gist options
  • Select an option

  • Save tim-smart/317152 to your computer and use it in GitHub Desktop.

Select an option

Save tim-smart/317152 to your computer and use it in GitHub Desktop.
hookIO.addListener('JsonrpcRequest', function(request, response) {
try {
var requestData = JSON.parse(request.body);
hookIO.emit('JsonrpcResponse', response,
hookIO.api[requestData.method].apply(hookIO.api, requestData.params));
} catch (error) {
hookIO.emit('Jsonrpc404Response', response, error);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment