Skip to content

Instantly share code, notes, and snippets.

@SomeoneWeird
Created June 26, 2015 04:46
Show Gist options
  • Save SomeoneWeird/8e92d9ccce916c2425f0 to your computer and use it in GitHub Desktop.
Save SomeoneWeird/8e92d9ccce916c2425f0 to your computer and use it in GitHub Desktop.
import ht from "hudson-taylor";
import methods from "./methods";
let transport = new ht.Transports.Local();
let service = new ht.Service(transport);
let client = new ht.Client({
s: transport
});
methods(service);
client.call('s', 'echo', 'hello world', function(err, data) {
console.log(err, data); // null 'hello world'
});
import { expose } from "ht-decorators";
export default function(service) {
class methods {
@expose(service)
echo(data, callback) {
return callback(null, data);
}
}
new methods();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment