Skip to content

Commit 890a963

Browse files
author
Wasin Waeosri
committed
Merge branch 'b1_expressjs'
1. Update to have a bundled simple web server using express.js 2. Update link in README.md 3. Update JSON format to match the Elektron WebSocket API format in ADS 3.2 rrg
2 parents 0e7e48c + 77e2a80 commit 890a963

File tree

8 files changed

+2822
-24
lines changed

8 files changed

+2822
-24
lines changed

README.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,32 @@
11
# Elecktron WebSocket API with TypeScript Example
22
## Overview
33

4-
[Elektron WebSocket API](https://developers.thomsonreuters.com/elektron/websocket-api-early-access) enables easy integration into a multitude of client technology environments such as scripting and web. This API runs directly on your TREP infrastructure or the Thomson Reuters platform and presents data in an open (JSON) readable format. The API supports all Thomson Reuters Elektron data models and can be integrated into multiple client technology standards e.g. Python, R, .Net etc.
4+
[Elektron WebSocket API](https://developers.thomsonreuters.com/websocket-api) enables easy integration into a multitude of client technology environments such as scripting and web. This API runs directly on your TREP infrastructure or the Thomson Reuters platform and presents data in an open (JSON) readable format. The API supports all Thomson Reuters Elektron data models and can be integrated into multiple client technology standards e.g. Python, R, .Net etc.
55

66
[TypeScript](https://www.typescriptlang.org) programming language is a typed superset of JavaScript that compiles to readable, standards-based JavaScript. The language is designed for application-scale JavaScript by adding optional types, classes, modules, ECMAScript 2015 features and future proposals to JavaScript. TypeScript supports tools for large-scale JavaScript applications for any browser, for any host, on any OS. TypeScript is as a first-class programming language in Microsoft Visual Studio, [Angular](https://angularjs.org/) web application platform. It also supported by various application frameworks like [React](https://github.com/Microsoft/TypeScript-React-Starter#typescript-react-starter), [NodeJS and Express framework](https://github.com/Microsoft/TypeScript-Node-Starter#typescript-node-starter), [ASP.Net Core](https://www.typescriptlang.org/docs/handbook/asp-net-core.html), [Vue.js](https://github.com/Microsoft/TypeScript-Vue-Starter#typescript-vue-starter) and more.
77

88
This example shows how to implement the Elektron WebSocket API JavaScript web application with TypeScript. The web application source codes are implemented in TypeScript language to connect, consume and display data from the ADS server via the Elektron WebSocket API in the web browsers. All source codes will be compiled to readable JavaScript with [Webpack](https://webpack.js.org/) JavaScript module bundler.
99

10+
*Note: The initial release of this API is for deployed TREP customers only (i.e. to use it you will need an installed version of TREP 3.2).
11+
1012
## Supported Web Browsers
1113
The example supports Chrome, Firefox and IE11 (based on the WebSocket and Web Workers browser supported platform).
1214

1315
## Prerequisite
1416
This example requires the following dependencies softwares.
1517
1. [Node.js](https://nodejs.org/en/) - version 6.10 or higher.
1618
2. [npm](https://www.npmjs.com/) package manager (included in Node.js)
17-
2. [TypeScript](https://www.typescriptlang.org)
19+
3. [TypeScript](https://www.typescriptlang.org) compiler
20+
4. [Express.js](https://expressjs.com/) web framework
1821

1922
This example also uses the following 3rd party libraries for UI presentation.
2023
1. [jQuery 3.2.1](https://jquery.com/)
2124
2. [Bootstrap 3.3.7](https://getbootstrap.com/docs/3.3/)
2225

23-
Both of jQuery and Bootstrap are distributed under the [MIT license](https://opensource.org/licenses/MIT). Please see more detail in the LICENSE.md file.
26+
jQuery,Bootstrap and Express.js are distributed under the [MIT license](https://opensource.org/licenses/MIT). Please see more detail in the LICENSE.md file.
2427

2528
## Package
26-
The project includes complete TypeScript source code, CSS files and all required static dependencies. The dynamic dependencies for compiling and building JavaScript source file are defined in *package.json* file which can be installed via ```npm install``` command.
29+
The project includes complete TypeScript source codes, a simple Express.js web server applciation file, CSS files and all required static dependencies. The dynamic dependencies for compiling and building JavaScript source file are defined in *package.json* file which can be installed via ```npm install``` command.
2730

2831
The project includes the following files and folder
2932
- *src/* folder: The folder that contains all TypeScript source files
@@ -36,7 +39,7 @@ The project includes the following files and folder
3639
- package.json: Project's NPM dependencies file
3740
- tsconfig.json: Project's TypeSccript compiler options file
3841
- webpack.config.js: Project's Webpack compiler options file
39-
42+
- server.js: Project's simple web server application file.
4043

4144
## How to run this example application
4245
1. Unzip or download the example project folder into a directory of your choice
@@ -49,14 +52,17 @@ The project includes the following files and folder
4952

5053
![webpack command display](images/webpack_screen2.png "webpack command display")
5154

52-
5. Copy and deploy the *web* folder into in any web server (recommend [http-server](https://www.npmjs.com/package/http-server) for quick dev/testing)
53-
6. Open web browser, then navigate to index.html of the web server (example for http-server: ```hhttp://localhost:8080/index.html```)
55+
5. Run ```$> node server.js``` in the command prompt to start the web server at HTTP port 8080
56+
57+
![application display](images/run_server.png "run server")
58+
59+
6. Open web browser (IE11, Chorme and Firefox), then navigate to index.html of the web server at ```http://localhost:8080/index.html```
5460

5561
![application display](images/application_screen.png "application display")
5662

5763
## References
5864
For further details, please check out the following resources:
59-
* [Thomson Reuters Elektron WebSocket API page](https://developers.thomsonreuters.com/elektron/websocket-api-early-access) on the [Thomson Reuters Developer Community](https://developers.thomsonreuters.com/) web site.
65+
* [Thomson Reuters Elektron WebSocket API page](https://developers.thomsonreuters.com/websocket-api) on the [Thomson Reuters Developer Community](https://developers.thomsonreuters.com/) web site.
6066
* [TypeScript programming language: Documentation](https://www.typescriptlang.org/docs/home.html).
6167
* [Mozilla Developer Network: Web Workers API page](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API)
6268

images/run_server.png

24.3 KB
Loading

0 commit comments

Comments
 (0)