1.0.0-alpha.1 • Published 2 years ago
@openplains/grass-js-client v1.0.0-alpha.1
(In Development) grass-js-client
A JavaScript REST API client for django-actinia or Actinia REST APIs.
Getting Started
grass-js-client works with django-actinia and Actinia 4.2.1.
Documentation
https://tomorrownow.github.io/grass-js-client/
Install
npm install grass-js-client
Configuration
Set your api settings in src/settings.js
{
"API_HOST": "http://localhost:8005/savana",
"API_SOURCE": ["actinia", "openplains"],
"ACTINIA_VERSION": "4.2.1",
"LANGUAGE": "en",
"APP_NAME": "OpenPlains",
"APP_ICON": "",
"PLUGINS": [
{
"name": "actinia_statistic_plugin",
"version": "0.2.0"
},
{
"name": "actinia_satellite_plugin",
"version": "0.1.0"
},
{
"name": "actinia_metadata_plugin",
"version": "1.0.2"
},
{
"name": "actinia_module_plugin",
"version": "2.3.1"
},
{
"name": "actinia_stac_plugin",
"version": "0.1.0"
},
{
"name": "actinia_tiling_plugin",
"version": "1.0.0"
},
{
"name": "actinia_api",
"version": "3.3.0"
}
]
}
Make requests to the API...
import Grass from "Grass";
// Get a list of avaliable locations
let response = await Grass.routes.Locations.getLocations()
// Get info about a location
let info = await Grass.routes.Locations.getLocation('nc_spm_08')
More documentation to come...
Contribute
Set up your node environment and install dependencies
nvm use
npm install
Testing
Run Jest test using the following commnad.
npm run lint
npm run test
Build
Run Jest test using the following commnad.
npm run build
Docs
Run JSDocs to build docs into the /docs
directory
npm run docs