]>
git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/thrift/lib/nodejs/examples/httpServer.js
1 var thrift
= require('thrift');
2 var helloSvc
= require('./gen-nodejs/HelloSvc');
4 //ServiceHandler: Implement the hello service
6 hello_func: function (result
) {
7 console
.log("Received Hello call");
8 result(null, "Hello from Node.js");
12 //ServiceOptions: The I/O stack for the service
14 handler
: helloHandler
,
16 protocol
: thrift
.TJSONProtocol
,
17 transport
: thrift
.TBufferedTransport
20 //ServerOptions: Define server features
27 //Create and start the web server
29 thrift
.createWebServer(serverOpt
).listen(port
);
30 console
.log("Http/Thrift Server running on port: " + port
);