@fnndsc/chrisapi
ChRIS API
JavaScript 6 client for the ChRIS API.
Installation
npm i @fnndsc/chrisapi
API Documentation
If you have a ChRIS server up and running (eg. as explained below) then you can test the API in your Javascript code.
For more information visit the API documentation
Development and testing
ChRIS server preconditions
These preconditions are only necessary to be able to test the client against an actual instance of a ChRIS server both during development and for the automated tests.
Install latest Docker
Currently tested platforms:
Docker Engine v25.0.0+
On a Linux machine make sure to add your computer user to the docker group
Install latest just command runner.
Fire up the full set of ChRIS services:
Open a terminal and run the following commands in any working directory:
__CODE_BLOCK_1__gt; git clone https://github.com/FNNDSC/ChRIS_ultron_backEnd.git
__CODE_BLOCK_1__gt; cd ChRIS_ultron_backEnd
__CODE_BLOCK_1__gt; just
Check that all the services are up:
__CODE_BLOCK_2__gt; docker ps -a
Create test data:
Run the following shell script on the directory of this README file.
NOTE: The script depends on the popular curl and jq command line tools.
__CODE_BLOCK_3__gt; ./pre_test.sh
Tear down the full set of ChRIS services:
You can later remove all the backend containers and release storage volumes with:
$ cd ChRIS_ultron_backEnd
$ just nuke
JavaScript package manager prerequisite
- yarn
Open a terminal in the directory of this README file
Commands
Install dependencies
__CODE_BLOCK_5__gt; yarn install
Start tests in watch mode (used for developing)
__CODE_BLOCK_6__gt; yarn start
Start test in single run mode (used by Travis CI)
__CODE_BLOCK_7__gt; yarn test
Compile library to standalone bundle
__CODE_BLOCK_8__gt; yarn build
Generate source code documentation
__CODE_BLOCK_9__gt; yarn docs