| Simon Hürlimann (CyT) | d732321 | 2015-03-30 12:37:48 +0200 | [diff] [blame^] | 1 | License |
| 2 | ------- |
| 3 | Licensed to the Apache Software Foundation (ASF) under one |
| 4 | or more contributor license agreements. See the NOTICE file |
| 5 | distributed with this work for additional information |
| 6 | regarding copyright ownership. The ASF licenses this file |
| 7 | to you under the Apache License, Version 2.0 (the |
| 8 | "License"); you may not use this file except in compliance |
| 9 | with the License. You may obtain a copy of the License at |
| T Jake Luciani | 0c124bb | 2011-01-08 03:49:16 +0000 | [diff] [blame] | 10 | |
| Simon Hürlimann (CyT) | d732321 | 2015-03-30 12:37:48 +0200 | [diff] [blame^] | 11 | http://www.apache.org/licenses/LICENSE-2.0 |
| T Jake Luciani | 0c124bb | 2011-01-08 03:49:16 +0000 | [diff] [blame] | 12 | |
| Simon Hürlimann (CyT) | d732321 | 2015-03-30 12:37:48 +0200 | [diff] [blame^] | 13 | Unless required by applicable law or agreed to in writing, |
| 14 | software distributed under the License is distributed on an |
| 15 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 16 | KIND, either express or implied. See the License for the |
| 17 | specific language governing permissions and limitations |
| 18 | under the License. |
| T Jake Luciani | 0c124bb | 2011-01-08 03:49:16 +0000 | [diff] [blame] | 19 | |
| Simon Hürlimann (CyT) | d732321 | 2015-03-30 12:37:48 +0200 | [diff] [blame^] | 20 | ## Running the user example |
| T Jake Luciani | 0c124bb | 2011-01-08 03:49:16 +0000 | [diff] [blame] | 21 | |
| Simon Hürlimann (CyT) | d732321 | 2015-03-30 12:37:48 +0200 | [diff] [blame^] | 22 | Generate the bindings: |
| Henrique Mendonça | a9e6248 | 2013-09-20 16:47:02 +0200 | [diff] [blame] | 23 | |
| Simon Hürlimann (CyT) | d732321 | 2015-03-30 12:37:48 +0200 | [diff] [blame^] | 24 | ../../../compiler/cpp/thrift --gen js:node user.thrift |
| 25 | ../../../compiler/cpp/thrift --gen js:node --gen py hello.thrift |
| 26 | |
| 27 | To run the user example, first start up the server in one terminal: |
| 28 | |
| 29 | NODE_PATH=../lib:../lib/thrift node server.js |
| 30 | |
| 31 | Now run the client: |
| 32 | |
| 33 | NODE_PATH=../lib:../lib/thrift node client.js |
| 34 | |
| 35 | For an example using JavaScript in the browser to connect to |
| 36 | a node.js server look at hello.html, hello.js and hello.thrift |
| 37 | |
| 38 | HTTP examples are provided also: httpClient.js and httpServer.js |
| 39 | You can test HTTP cross platform with the httpServer.py Python server |