-
Notifications
You must be signed in to change notification settings - Fork 88
Hello World
小马哥 edited this page Aug 9, 2015
·
4 revisions
首先让我们从 Hello World 开始。
var hprose = require("hprose");
function hello(name) {
return "Hello " + name + "!";
}
var server = hprose.Server.create("http://0.0.0.0:8080");
server.addFunction(hello);
server.start();
启动服务器:
node server.js
var hprose = require("hprose");
var client = hprose.Client.create("http://127.0.0.1:8080/", ['hello']);
client.hello("world", function(result) {
console.log(result);
});
启动客户端:
node client.js
Hprose for Node.js 用户手册