https://github.com/intersystems/quickstarts-nodejs
Repo for sample files for Node.js QuickStart
https://github.com/intersystems/quickstarts-nodejs
Last synced: 5 months ago
JSON representation
Repo for sample files for Node.js QuickStart
- Host: GitHub
- URL: https://github.com/intersystems/quickstarts-nodejs
- Owner: intersystems
- License: mit
- Created: 2019-01-25T19:21:30.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-12-09T16:37:50.000Z (over 1 year ago)
- Last Synced: 2024-12-09T17:36:44.763Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 714 KB
- Stars: 1
- Watchers: 12
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Quickstart-nodejs
This code shows how to use a Node.js application with an InterSytems server. It is used in the online exercise [Node.js quickstart](https://learning.intersystems.com/course/view.php?name=Node.js%20QS).
# Contents
* `connections.config`: contains connection details, including `ip`, `port`, `namespace`, `username`, `password`.
* `all_stocks.csv`: contains 1000 stock data from New York Stock Exchange
* `nodeplaystocksTask1.js`: Store test data directly to InterSystems server
* `nodeplaystocksTask2.js`: Store stock data directly to InterSystems server using a custom structure.
* `nodeplaystocksTask3.js`: Retrieve stock data directly from InterSystems server
* `nodeplaystocksTask4.js`: Generate trade data with methods from InterSystems server
* `nodeplaystocksTask5.js`: Call routine directly to print the version of InterSystems server
# Requirements
* Instance of [InterSystems IRIS](https://learning.intersystems.com/course/view.php?name=Get%20InterSystems%20IRIS) or another InterSystems server
* an IDE that supports Node.js (such as **Visual Studio Code**)
* Install the necessary node modules:
* readline-sync (use npm to install)
* file-system (use npm to install)
* intersystems-iris-native (find in *iris-install-dir*/dev/nodejs/)
# How to run
1. Clone this repo.
2. Install the node module requirements, listed above. Install them either globally on your system or locally within this repo. To get the intersystems-iris-native module from a containerized InterSystems server, use a *docker cp* command to copy the intersystems-iris-native directory from /usr/irissys/dev/nodejs/ out of the container into your repo.
3. In your IDE, open the file`connections.config`. Modify the *IP*, *port*, *username*, and *password* for your InterSystems server.
5. In a terminal, run the sample code. To run a file, type: `node filename.js`, replacing `filename.js` with the name of the file you want to run.