Created
June 26, 2015 04:46
-
-
Save SomeoneWeird/8e92d9ccce916c2425f0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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