JavaScript 6 client for the ChRIS API.
npm i @fnndsc/chrisapi
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
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.
Currently tested platforms:
Docker 18.06.0+
Docker Compose 1.27.0+
Ubuntu 18.04+ and MAC OS X 10.14+
Open a terminal and run the following commands in any working directory:
$> git clone https://github.com/FNNDSC/ChRIS_ultron_backEnd.git
$> cd ChRIS_ultron_backEnd
$> ./make.sh -U -I -i
Check that all the services are up:
$> docker ps -a
Using curl:
curl -u cube:cube1234 -XPOST -H 'Content-Type: application/vnd.collection+json' -H 'Accept: application/vnd.collection+json' -d '{"template":{"data":[{"name":"dir", "value":"home/cube/uploads"}]}}' 'http://localhost:8000/api/v1/plugins/2/instances/'
Using HTTPie REST API client:
http -a cube:cube1234 POST http://localhost:8000/api/v1/plugins/2/instances/ template:='{"data":[{"name":"dir", "value":"home/cube/uploads"}]}' Content-Type:application/vnd.collection+json Accept:application/vnd.collection+json
Using curl:
curl -u cube:cube1234 http://localhost:8000/api/v1/plugins/instances/1/
Using HTTPie REST API client:
http -a cube:cube1234 http://localhost:8000/api/v1/plugins/instances/1/
Keep making this GET request until the "status"
descriptor in the response becomes "finishedSuccessfully"
You can later remove all the backend containers and release storage volumes with:
$ cd ChRIS_ultron_backEnd
$ ./unmake.sh
- yarn
Open a terminal in the directory of this README file
Install dependencies
$> yarn install
Start tests in watch mode (used for developing)
$> yarn start
Start test in single run mode (used by Travis CI
)
$> yarn test
Compile library to standalone bundle
$> yarn build
Generate source code documentation
$> yarn docs