From 19fcec84d8d7d21e796c7624e521b60d28ee21ed Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 20:45:59 +0200 Subject: Adding upstream version 16.2.11+ds. Signed-off-by: Daniel Baumann --- .../thrift/lib/nodejs/examples/hello.html | 65 ++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 src/jaegertracing/thrift/lib/nodejs/examples/hello.html (limited to 'src/jaegertracing/thrift/lib/nodejs/examples/hello.html') diff --git a/src/jaegertracing/thrift/lib/nodejs/examples/hello.html b/src/jaegertracing/thrift/lib/nodejs/examples/hello.html new file mode 100644 index 000000000..fe85a7e9d --- /dev/null +++ b/src/jaegertracing/thrift/lib/nodejs/examples/hello.html @@ -0,0 +1,65 @@ + + + + + Apache Thrift JavaScript Browser Client Demo + + + + + +

Apache Thrift JavaScript Browser Client Demo

+

This html file demonstrates Apache Thrift JavaScrpt RPC between a browser client to a node.js server. Clicking the buttons below will call the RPC functions hosted by the Apache Thrift server at localhost:8585. The file hello.js contains the JavaScript node.js server required. Here are the steps to get the example running:

+
    +
  1. Install Node.js
    nodejs.org
  2. +
  3. Install Apache Thrift for node (note that the node package manager will create the node_modules folder in the current directory so make sure to run npm from the same directory as hello.js so that the server can find the Thrift libraries. This example requires Apache Thrift 0.9.2+)
    $ npm install thrift
  4. +
  5. Compile the hello.idl for JavaScript and Node.js (you'll need to have the Apache Thrift compiler installed for this step. This also needs to be executed in the same directory as hello.js because hello.js and hello.html look for the gen-nodejs and gen-js directories here.)
    $ thrift -gen js -gen js:node hello.thrift
  6. +
  7. Run the node server in the directory with the hello.html file
    $ node hello.js
  8. +
  9. Copy the Apache Thrift JavaScript library, thrift.js, into the directory with this html file.
    $ cp ...../thrift.js . (you should be able to use Bower to install the browser based Apache Thrift library in the near future.)
    +
  10. Reload this page in a browser through the node server using using the URL:
    http://localhost:8585/hello.html
    then click a button below to make an RPC call
  11. +
+ + + +

Server Response:

+

Server Dbl:

+ + + -- cgit v1.2.3